Skip to main content

Search and Top Navigation

#4572 closed bug (fixed)

Opened June 02, 2009 07:45AM UTC

Closed October 22, 2010 08:14PM UTC

nested tabsets have ui-state-disabled copied from parent tabset

Reported by: bjscott Owned by:
Priority: major Milestone: 1.8
Component: ui.tabs Version: 1.7.1
Keywords: nested tabs Cc:
Blocked by: Blocking:
Description

If I have a nested tabset and the parent tabset has a bad link (which gets disabled) the nested tabset has the link in the same position disabled. The following code shows this behaviour, the nested tabset in Tab 2 has its second tab disabled incorrectly.

<script type="text/javascript">

$(function() {

$('#tabset1').tabs();

$('#tabset2').tabs();

});

</script>

<div id="tabset1">

<ul>

<li><a href="#tab1"><span>Tab 1</span></a></li>

<li><a href="#"><span>FAIL</span></a></li>

<li><a href="#tab2"><span>Tab 2</span></a></li>

<li><a href="#tab3"><span>Tab 3</span></a></li>

<li><a href="#tab4"><span>Tab 4</span></a></li>

</ul>

<div id="tab1">

content tab1

</div>

<div id="tab2">

<div id="tabset2">

<ul>

<li><a href="#tab5"><span>Tab 5</span></a></li>

<li><a href="#tab6"><span>Tab 6 (incorrectly disabled)</span></a></li>

<li><a href="#tab7"><span>Tab 7</span></a></li>

<li><a href="#tab8"><span>Tab 8</span></a></li>

</ul>

<div id="tab5">

content tab5

</div>

<div id="tab6">

content tab6

</div>

<div id="tab7">

content tab7

</div>

<div id="tab8">

content tab8

</div>

</div>

</div>

<div id="tab3">

content tab3

</div>

<div id="tab4">

content tab4

</div>

</div>

Attachments (0)
Change History (3)

Changed June 02, 2009 12:42PM UTC by jzaefferer comment:1

milestone: TBD1.8

Probably some selector that is too greedy and needs to be restricted to children.

Changed January 22, 2010 11:55AM UTC by rio comment:2

It's not a selector that is greedy, nor is this bug limited to nested tabsets.

The problem is the fact that $.ui.tabs.defaults.disabled is not deep-copied for each separate instance of the tabs widget. All instances of the widget end up sharing the same array of indices to disabled tabs.

A current workaround is to explicitly pass an empty array in the options to each individual tab, e.g.,

$(".all-tabsets").each(function(){ $(this).tabs({disabled: []}) });

Changed October 22, 2010 08:14PM UTC by scottgonzalez comment:3

milestone: 1.91.8
resolution: → fixed
status: newclosed

This was fixed with the widget factory update in 1.8.