From 4ab4684cfc36f8afe8782eb0501b51c420d478ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 1 Oct 2012 15:34:44 -0400 Subject: [PATCH] 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. --- ui/jquery.ui.dialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index bcbb68c5a..77424047c 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -216,7 +216,8 @@ $.widget("ui.dialog", { } next = oldPosition.parent.children().eq( oldPosition.index ); - if ( next.length ) { + // Don't try to place the dialog next to itself (#8613) + if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { next.before( this.element ); } else { oldPosition.parent.append( this.element ); -- 2.39.5