Skip to main content

Search and Top Navigation

#3683 closed bug (fixed)

Opened December 20, 2008 04:13PM UTC

Closed January 10, 2009 12:36PM UTC

Last modified January 17, 2010 06:08AM UTC

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:

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.

Attachments (1)
  • test2.html (0.7 KB) - added by torq December 20, 2008 04:14PM UTC.

    Semi-self contained demonstration of issue behaviour; needs links to jQuery and jQueryUI

Change History (5)

Changed January 02, 2009 02:15PM UTC by scottgonzalez comment:1

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

Changed January 04, 2009 03:56AM UTC by scottgonzalez comment:2

milestone: TBD1.6
priority: minorcritical

Changed January 04, 2009 12:49PM UTC by klaus.hartl comment:3

owner: → klaus.hartl
status: newassigned

Changed January 05, 2009 07:29PM UTC by 4pcbr comment:4

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;




o.selected = null;


Changed January 10, 2009 12:36PM UTC by klaus.hartl comment:5

resolution: → fixed
status: assignedclosed