Skip to content

Commit 4ab4684

Browse files
committed
Dialog: Don't try to place the dialog next to itself on destroy. Fixes #8613 - Destroying a dialog removes the original element from the DOM.
1 parent 9b0c8b7 commit 4ab4684

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/jquery.ui.dialog.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ $.widget("ui.dialog", {
216216
}
217217

218218
next = oldPosition.parent.children().eq( oldPosition.index );
219-
if ( next.length ) {
219+
// Don't try to place the dialog next to itself (#8613)
220+
if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
220221
next.before( this.element );
221222
} else {
222223
oldPosition.parent.append( this.element );

0 commit comments

Comments
 (0)