Skip to content

Commit c090802

Browse files
committed
Revert "Dialog: Don't change DOM position on open. Fixes #6137 - dialog('open') causes form elements to reset on IE7."
This reverts commit 67b1db1. Reverting so I can commit again with the proper author.
1 parent 67b1db1 commit c090802

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

tests/unit/dialog/dialog_tickets.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,4 @@ test("#5531: dialog width should be at least minWidth on creation", function ()
6161

6262
});
6363

64-
test("#6137: dialog('open') causes form elements to reset on IE7", function() {
65-
expect(2);
66-
67-
d1 = $('<form><input type="radio" name="radio" id="a" value="a" checked="checked"></input>' +
68-
'<input type="radio" name="radio" id="b" value="b">b</input></form>').dialog({autoOpen: false});
69-
70-
d1.find('#b')[0].checked = true;
71-
equal($('input:checked').val(), 'b', "checkbox b is checked");
72-
73-
d2 = $('<div></div>').dialog({autoOpen: false});
74-
75-
d1.dialog('open');
76-
equal($('input:checked').val(), 'b', "checkbox b is checked");
77-
78-
d1.add(d2).remove();
79-
})
80-
8164
})(jQuery);

ui/jquery.ui.dialog.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ $.widget("ui.dialog", {
309309
uiDialog = self.uiDialog;
310310

311311
self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null;
312+
if (uiDialog.next().length) {
313+
uiDialog.appendTo('body');
314+
}
312315
self._size();
313316
self._position(options.position);
314317
uiDialog.show(options.show);

0 commit comments

Comments
 (0)