Bug Tracker

Opened 11 years ago

Closed 11 years ago

#3505 closed bug (invalid)

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.

Change History (2)

comment:1 Changed 11 years ago by c_schmitz

Another simpler test case:

$tabs = $("#tabPageSections > ul").tabs({
        cache: true,
        ajaxOptions:{
            dataType:"html",
            success: attachevents
        }
    });

Code snippet for delete

   var selected = $tabs.data('selected.tabs');   
   alert (selected);
   $("#tabPageSections > ul").tabs("remove",selected);  

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.

comment:2 Changed 11 years ago by flesler

Resolution: invalid
Status: newclosed

Please repost this to the UI Bug Tracker.

Note: See TracTickets for help on using tickets.