Opened 8 years ago

Closed 8 years ago

#8195 closed bug (cantfix)

Using .replaceWith on a dialog will cause it to disappear.

Reported by: sp2 Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.dialog Version: 1.8.18
Keywords: Cc:
Blocked by: Blocking:

Description

If you call .dialog on a div, and then replace that div with .replaceWith, the old div and the new div will be removed from the DOM. I believe this has to do with the .dialog creating a wrapper div to house the dialog ui. .replaceWith attaches the new div to that wrapper, but then something happens and the whole thing gets removed.

See http://jsfiddle.net/pUrYj/12/ for example. Both buttons should replace the dialog with new content, but the one on the left causes the dialog to disappear instead. Also, this may not be isolated to just the dialog.

Change History (1)

comment:1 Changed 8 years ago by Scott González

Resolution: cantfix
Status: newclosed

.replaceWith() removes the DOM element. Removing an element that a widget is initialized against will destroy the widget. Destroy a dialog removes the generated wrapper. jQuery stores a reference to the wrapper to know where to insert the new element. There's nothing we can do about this.

Note: See TracTickets for help on using tickets.