Skip to content

Commit a7aa65d

Browse files
committed
Accordion - Make sure we have an element before trying to modify the className. Fixes #6856 - Accordion: Opening a panel after all panels have been collapsed causes an error.
1 parent 13ca484 commit a7aa65d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/jquery.ui.accordion.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,9 @@ $.widget( "ui.accordion", {
504504
// other classes are removed before the animation; this one needs to stay until completed
505505
this.toHide.removeClass( "ui-accordion-content-active" );
506506
// Work around for rendering bug in IE (#5421)
507-
this.toHide.parent()[0].className = this.toHide.parent()[0].className;
507+
if ( this.toHide.length ) {
508+
this.toHide.parent()[0].className = this.toHide.parent()[0].className;
509+
}
508510

509511
this._trigger( "change", null, this.data );
510512
}

0 commit comments

Comments
 (0)