Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#3683 closed bug (fixed)

Can't initialize an empty <ul> tabset

Reported by: torq Owned by: klaus.hartl
Priority: critical Milestone: 1.7
Component: ui.tabs Version: 1.6rc2
Keywords: empty tabset ul Cc:
Blocked by: Blocking:

Description

Both Firefox 3.0.5 and Opera 9.02 'hang' or break the flow of execution when attempting to initialize an empty <ul></ul> as a tabset.

If tabtest is a div containing an empty <ul></ul>, then this will fail :

$("#tabtest > ul").tabs();
$("#tabtest > ul").tabs("add", "#fragment1", "tab1");

But if there's something already in the <ul>, then it will succeed, like so :

$("#tabtest > ul").append("<li><a href='#fragment0'><span>tab0</span></a></li>");
$("#tabtest > ul").tabs();
$("#tabtest > ul").tabs("add", "#fragment1", "tab1");

In the attached .html, you should see an alert("done!") if and when the browser has finished creating the tabs. In the failure case, this alert never appears.

Change History (5)

comment:1 Changed 7 years ago by scottgonzalez

See jquery-ui-dev thread about whether this should be supported.

comment:2 Changed 7 years ago by scottgonzalez

  • Milestone changed from TBD to 1.6
  • Priority changed from minor to critical

comment:3 Changed 7 years ago by klaus.hartl

  • Owner set to klaus.hartl
  • Status changed from new to assigned

comment:4 Changed 7 years ago by 4pcbr

Here is an error behaviour in setting a first tab as selected by default at ui.tabs.js at line 116

o.selected = o.selected === null
o.selected !== undefined ? o.selected : 0; first tab selected by default

I've fixed it next way:

if (this.$tabs.length) {

o.selected = o.selected === null
o.selected !== undefined ? o.selected : 0;

} else {

o.selected = null;

}

comment:5 Changed 7 years ago by klaus.hartl

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.