#5841 closed bug (fixed)
Accordion active property inaccurate if nested accordion is present
Reported by: | Nick_Craver | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8.3 |
Component: | ui.accordion | Version: | 1.8.2 |
Keywords: | accordion nested active | Cc: | |
Blocked by: | Blocking: |
Description
I've setup a full demo here: http://jsfiddle.net/nick_craver/RJgaG/
If you click on any section you'll see the index is including the child accordion's headers. It's happening because of how .active is set:
o.active = o.collapsible && clickedIsActive ? false : $('.ui-accordion-header', this.element).index(clicked);
It's looking for all headers, not just the ones belonging to this level accordion. It seems like it should be:
o.active = o.collapsible && clickedIsActive ? false : this.headers.index(clicked);
Here's that version running: http://jsfiddle.net/nick_craver/dK6SD/
Change History (4)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Milestone: | TBD → 1.9 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in f99068b. Thanks.
comment:3 Changed 13 years ago by
Milestone: | 1.9 → 1.8.3 |
---|
comment:4 Changed 13 years ago by
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.
Changeset: f99068bb4ff7fc0ceec154ac8e3b63e088246047
To be clear what the bug is without viewing the demo, the active option of the accordion widget is incorrect if there's a nested accordion present. It's headers will be factored into the the active index calculation when they shouldn't be, causing an inaccurate, higher index to be reported.