Opened 10 years ago
Closed 10 years ago
#8568 closed bug (fixed)
jQuery ui tabs: wrong default active li if ul contains extraneous elements
Reported by: | erethnor | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.1 |
Component: | ui.tabs | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
You can see the problem on this jsFiddle.
There, the second tab is selected by default, when the first should be active instead.
This is caused by this line:
active = this.tabs.eq( active ).index();
replacing it with the line below fixes the problem:
active = this.tabs.index( this.tabs.eq( active ) );
Please do not disregard this as not a bug because there shouldn't be a LI
without a A
there anyway; in my case the extraneous elements are created by css3pie and I cannot feasibly move them out of the UL
.
Change History (5)
comment:1 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 10 years ago by
Milestone: | 1.9.0 → git |
---|
comment:3 Changed 10 years ago by
This needs to be reopened as there is a very similar problem when using the ui-tabs-active
class to mark one tab as active via HTML on load.
This line:
active = this.tabs.filter( ".ui-tabs-active" ).index();
Should be:
active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
I tried to browse the code to check if there is more code using .index()
not strictly enough but couldn't see any - maybe worth a watch from somebody knowing the code more though?
comment:4 Changed 10 years ago by
Milestone: | git → 1.9.1 |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Version: | 1.9.0-rc.1 → 1.9.0 |
comment:5 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Tabs: Handle extraneous list items when using ui-tabs-active to set the initially active tab. Fixes #8568 - jQuery ui tabs: wrong default active li if ul contains extraneous elements.
Changeset: fa62f21e5ad09e5368efc3079859730e23a7123b
Tabs: Account for non-tab list items on init. Fixes #8568 - jQuery ui tabs: wrong default active li if ul contains extraneous elements.