Search and Top Navigation
#5841 closed bug (fixed)
Opened July 20, 2010 07:57PM UTC
Closed July 20, 2010 08:15PM UTC
Last modified November 19, 2010 06:26PM UTC
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/
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.