]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Don't change DOM position on open. Fixes #6137 - dialog('open') causes form...
authorJohn Firebaugh <john_firebaugh@bigfix.com>
Fri, 1 Oct 2010 22:46:19 +0000 (15:46 -0700)
committerScott González <scott.gonzalez@gmail.com>
Mon, 4 Oct 2010 13:18:46 +0000 (09:18 -0400)
tests/unit/dialog/dialog_tickets.js
ui/jquery.ui.dialog.js

index dfa480fb74ce30cbabe32b3b659111c763be82d4..f7b590b530112981982423413cdb37a2435ba17a 100644 (file)
@@ -61,4 +61,21 @@ test("#5531: dialog width should be at least minWidth on creation", function ()
 
 });
 
+test("#6137: dialog('open') causes form elements to reset on IE7", function() {
+       expect(2);
+
+       d1 = $('<form><input type="radio" name="radio" id="a" value="a" checked="checked"></input>' +
+                               '<input type="radio" name="radio" id="b" value="b">b</input></form>').dialog({autoOpen: false});
+
+       d1.find('#b')[0].checked = true;
+       equal($('input:checked').val(), 'b', "checkbox b is checked");
+
+       d2 = $('<div></div>').dialog({autoOpen: false});
+
+       d1.dialog('open');
+       equal($('input:checked').val(), 'b', "checkbox b is checked");
+
+       d1.add(d2).remove();
+})
+
 })(jQuery);
index 86dfa5fa1ee41655251e8f12ebbad78cbb6a1700..b000bf5bd99e7b4458325aa0a18588418e8a4731 100644 (file)
@@ -309,9 +309,6 @@ $.widget("ui.dialog", {
                        uiDialog = self.uiDialog;
 
                self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null;
-               if (uiDialog.next().length) {
-                       uiDialog.appendTo('body');
-               }
                self._size();
                self._position(options.position);
                uiDialog.show(options.show);