Skip to content

Commit 04ba0a2

Browse files
committed
Accordion: Don't change corner classes on the collapsing panel's header until after the animation completes. Fixed #8224 - bug: Accordion corner style applying order.
1 parent fa44e51 commit 04ba0a2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ui/jquery.ui.accordion.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,8 @@ $.widget( "ui.accordion", {
410410
this._toggle( eventData );
411411

412412
// switch classes
413-
active
414-
.removeClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
415-
.addClass( "ui-corner-all" );
413+
// corner classes on the previously active header stay after the animation
414+
active.removeClass( "ui-accordion-header-active ui-state-active" );
416415
if ( options.icons ) {
417416
active.children( ".ui-accordion-header-icon" )
418417
.removeClass( options.icons.activeHeader )
@@ -518,8 +517,12 @@ $.widget( "ui.accordion", {
518517
_toggleComplete: function( data ) {
519518
var toHide = data.oldContent;
520519

521-
// other classes are removed before the animation; this one needs to stay until completed
522-
toHide.removeClass( "ui-accordion-content-active" );
520+
toHide
521+
.removeClass( "ui-accordion-content-active" )
522+
.prev()
523+
.removeClass( "ui-corner-top" )
524+
.addClass( "ui-corner-all" );
525+
523526
// Work around for rendering bug in IE (#5421)
524527
if ( toHide.length ) {
525528
toHide.parent()[0].className = toHide.parent()[0].className;

0 commit comments

Comments
 (0)