Skip to main content

Search and Top Navigation

#8132 closed bug (notabug)

Opened February 22, 2012 10:38PM UTC

Closed February 23, 2012 12:05AM UTC

Content loaded via html and used in dialog becomes duplicated

Reported by: Mathachew Owned by: Mathachew
Priority: minor Milestone: 1.9.0
Component: ui.dialog Version: 1.8.17
Keywords: Cc:
Blocked by: Blocking:
Description

I have a table with a list of users and some of the information. When selecting a user, a sidebar is displayed with more detailed information about that user, pulled via ajax. Among the content that is loaded, one of the buttons will bring up a modal whose content is also loaded in the sidebar. Once I close the modal, pull up the next user and try to bring up the same modal, it comes up fine. However, I am unable to close the modal by calling $().dialog('destroy'). Upon inspecting the html, I noticed that the element that was loaded existed twice since the modal moves the element outside of the parent in which it was originally contained.

Attachments (0)
Change History (3)

Changed February 22, 2012 10:47PM UTC by scottgonzalez comment:1

owner: → Mathachew
status: newpending

I don't think you've described a bug. Please provide a reduced test case showing your problem.

Changed February 22, 2012 11:31PM UTC by Mathachew comment:2

status: pendingnew

Replying to [comment:1 scott.gonzalez]:

I don't think you've described a bug. Please provide a reduced test case showing your problem.

http://jsbin.com/ovasab/edit#javascript,html

This is a simplified version of what we're doing, but the result is the same. If I click the link to open multiple modals of the same content, I can then close any additional modals that I was unable to close previously. However, doing this results in multiple elements with the same id. Thanks.

[[Image(https://s3.amazonaws.com/uploads.hipchat.com/1916/6209/a9chkrkd66om90f/upload.png)]]

Changed February 23, 2012 12:05AM UTC by scottgonzalez comment:3

resolution: → invalid
status: newclosed

This is expected behavior. The dialog has to move in the DOM for z-index to work properly. You're leaving the dialog in the DOM and then loading new content with the same id and creating another dialog.