Skip to main content

Search and Top Navigation

#5954 closed bug (fixed)

Opened August 16, 2010 01:59PM UTC

Closed May 17, 2011 02:32PM UTC

Load event for Ajax tab can fire for the wrong tab

Reported by: asgeo1 Owned by:
Priority: major Milestone: 1.9.0
Component: ui.tabs Version: 1.8.4
Keywords: Cc: jqueryui@asgeo1.com
Blocked by: Blocking:
Description

The load event for a tab should fire once the ajax tab has been loaded.

Except I have noticed that there is a bug in the 1.8 series which can cause it to fire not for the tab that was loaded - but for the previous tab in the list.

Attached is an example which shows the problem.

The main bit to look for is how the tabs are setup:

<div class="tabs" id="mytabs">
    <ul class="ui-tabs-nav">
        <li class="ui-tabs-nav-item"><a href="#mytab1"><span>MyTab1</span></a></li>
        <li class="ui-tabs-nav-item"><a href="/test.htm"><span>MyTab2</span></a></li>
        <li class="ui-tabs-nav-item"><a href="#mytab3"><span>MyTab3</span></a></li>
    </ul>

    <div id="mytab3"><h1>MyTab3</h1></div>
    <div id="mytab1"><h1>MyTab1</h1></div>
</div>

If you click "!MyTab2", the alert should say "loaded: ui-tabs-1"

Instead it says "loaded: mytab1"

The bug is triggered by placing the panel for #mytab3 before #mytab1.

There seems to be an assumption that the ordering of the tab panels will be the same as the tab links.

But that is not a fair assumption. There are genuine reasons why they may not match.

I never had this bug in 1.7.x, so I assume some change in either jQuery UI 1.8.x or jQuery 1.4.x is causing this.

Let me know what you think.

Regards,

-asgeo1

Attachments (1)
  • jquery_bug.zip (105.7 KB) - added by asgeo1 August 16, 2010 01:59PM UTC.

    Demo of this bug in action

Change History (1)

Changed May 17, 2011 02:32PM UTC by scottgonzalez comment:1

milestone: TBD1.9
resolution: → fixed
status: newclosed

This is fixed in master.