Skip to content

Commit f99068b

Browse files
committed
Accordion: Use this.headers instead of parsing the DOM to find headers when determining which panel is active. Fixes #5841 - Accordion active property inaccurate if nested accordion is present.
1 parent e85615f commit f99068b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui/jquery.ui.accordion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ $.widget("ui.accordion", {
302302

303303
// TODO the option is changed, is that correct?
304304
// TODO if it is correct, shouldn't that happen after determining that the click is valid?
305-
o.active = o.collapsible && clickedIsActive ? false : $('.ui-accordion-header', this.element).index(clicked);
305+
o.active = o.collapsible && clickedIsActive ? false : this.headers.index(clicked);
306306

307307
// if animations are still active, or the active header is the target, ignore click
308308
if (this.running || (!o.collapsible && clickedIsActive)) {

0 commit comments

Comments
 (0)