Side navigation
#3505 closed bug (invalid)
Opened October 21, 2008 04:03PM UTC
Closed October 21, 2008 10:51PM UTC
jquery.ui.tabs - on multiple remove the selected tab does not get deleted but the following one
Reported by: | c_schmitz | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | plugin | Version: | 1.2.6 |
Keywords: | tabs UI removal tabindex | Cc: | |
Blocked by: | Blocking: |
Description
After removing a tab from a list of tabs the tabindex is messed up.
$tabs.data('selected.tabs') returns an invalid number.
I am using Firefox 3.0.3 (windows)
I create the tabs with
$(document).ready(function() {
$tabs = $("#tabPageSections > ul").tabs({
cache: true,
remove: function(ui){$("#tabPageSections > ul").tabs("select",0);},
select: function(ui){alert ($tabs.data('selected.tabs'));},
ajaxOptions:{
dataType:"html",
success: attachevents
}
});
}
This is the code to remove the currently selected tab:
var selected = $tabs.data('selected.tabs');
$("#tabPageSections > ul").tabs("remove",selected);
THis is what happens:
I have 4 tabs: Page 1, Page 2, Page 3, Page 4
1.)Page 1 is selected. A click on a link inside the tab removes the tab, after removal the 'new' first tab (Page 2) is selected. The alert box shows '0' - which is right.
I don't change any tabs and click the deletion link again.
This time page 2 is NOT deleted but page 3!? The alert is not fired.
It works flawlessly if I change the tab manually back and forth and delete then.
I guess the internal tab index get messed up.
Attachments (0)
Change History (2)
Changed October 21, 2008 04:23PM UTC by comment:1
Changed October 21, 2008 10:51PM UTC by comment:2
resolution: | → invalid |
---|---|
status: | new → closed |
Please repost this to the UI Bug Tracker.
Another simpler test case:
Code snippet for delete
After every delete the visually selected tab is 0, but the alert always returns(1). Delete is started by a mouse click on a link with oncklic event.