Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#3139 closed bug (worksforme)

UI Tabs ajax call breaks when other ajax requests remove tabs element

Reported by: anonymous Owned by: klaus.hartl
Priority: major Milestone:
Component: ui.tabs Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

Description

The success function in the ajax call made by the ui tab code does not check to make sure the tab div still exists before populating the html. In our case if a user has made a second request which removed the tab element, the ajax call for the tab still returns and blows up the app. The offending code is the $(a.hash).html(r); call in the success function. I simply add an if($(a.hash).is(":empty") around that line in the success and this seems to fix the problem.

success: function(r, s) {

if($(a.hash).is(":empty")) {

$(a.hash).html(r);

} ...

}

Change History (4)

comment:1 Changed 11 years ago by Cloudream

Milestone: TDB

comment:2 Changed 11 years ago by klaus.hartl

Can you provide a test case? I wonder how this would break anything, because if $(a.hash) doesn't match anything, no html will be populated.

comment:3 Changed 11 years ago by klaus.hartl

Resolution: worksforme
Status: newclosed

I also wonder how Tabs should behave in such border case. Create a new div?

comment:4 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.