Skip to content

Commit de75b40

Browse files
committed
Accordion: Handle box-sizing: border-box in animations
Fixes #9264 Closes jquerygh-1287 Closes jquerygh-1459 (cherry picked from commit 4b017b4)
1 parent 04ab6e0 commit de75b40

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ui/accordion.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ return $.widget( "ui.accordion", {
516516
var total, easing, duration,
517517
that = this,
518518
adjust = 0,
519+
boxSizing = toShow.css( "box-sizing" ),
519520
down = toShow.length &&
520521
( !toHide.length || ( toShow.index() < toHide.index() ) ),
521522
animate = this.options.animate || {},
@@ -558,7 +559,9 @@ return $.widget( "ui.accordion", {
558559
step: function( now, fx ) {
559560
fx.now = Math.round( now );
560561
if ( fx.prop !== "height" ) {
561-
adjust += fx.now;
562+
if ( boxSizing === "content-box" ) {
563+
adjust += fx.now;
564+
}
562565
} else if ( that.options.heightStyle !== "content" ) {
563566
fx.now = Math.round( total - toHide.outerHeight() - adjust );
564567
adjust = 0;

0 commit comments

Comments
 (0)