Skip to content

Commit e66cdfc

Browse files
John Firebaughscottgonzalez
authored andcommitted
Dialog: Don't change DOM position on open. Fixes #6137 - dialog('open') causes form elements to reset on IE7.
1 parent c090802 commit e66cdfc

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

tests/unit/dialog/dialog_tickets.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,21 @@ 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+
6481
})(jQuery);

ui/jquery.ui.dialog.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,6 @@ $.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-
}
315312
self._size();
316313
self._position(options.position);
317314
uiDialog.show(options.show);

0 commit comments

Comments
 (0)