From e16d9269e32d65137831443b8dc45c3c3d6b733e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 2 Mar 2015 18:43:07 -0500 Subject: [PATCH] Accordion: Handle `box-sizing: border-box` in animations Fixes #9264 Closes gh-1287 --- ui/accordion.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/accordion.js b/ui/accordion.js index cf53e9839f7..68a4c34ec0f 100644 --- a/ui/accordion.js +++ b/ui/accordion.js @@ -524,6 +524,7 @@ return $.widget( "ui.accordion", { var total, easing, duration, that = this, adjust = 0, + boxSizing = toShow.css( "box-sizing" ), down = toShow.length && ( !toHide.length || ( toShow.index() < toHide.index() ) ), animate = this.options.animate || {}, @@ -566,7 +567,9 @@ return $.widget( "ui.accordion", { step: function( now, fx ) { fx.now = Math.round( now ); if ( fx.prop !== "height" ) { - adjust += fx.now; + if ( boxSizing === "content-box" ) { + adjust += fx.now; + } } else if ( that.options.heightStyle !== "content" ) { fx.now = Math.round( total - toHide.outerHeight() - adjust ); adjust = 0;