#4065 closed bug (fixed)
modal dialog + button locks page
Reported by: | Vovochka | Owned by: | Scott González |
---|---|---|---|
Priority: | major | Milestone: | 1.7.2 |
Component: | ui.dialog | Version: | 1.6rc6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
After executing this code the page freezes (I can't follow links)
$("#oo_add_img_box") .dialog({ modal: true, buttons: { 'OK': function() { $(this).dialog('close'); } } }) .dialog('close');
But if I delete buttons section everything works fine
Attachments (1)
Change History (19)
comment:1 Changed 14 years ago by
Milestone: | TBD → 1.6 |
---|---|
Priority: | blocker → major |
Changed 14 years ago by
Attachment: | 4065-fix.diff added |
---|
This is the patch file which fixes the problem
comment:2 Changed 14 years ago by
Submited a fix for this as an attached patch file. Please send feedback/advice/criticisms if it doesn't meet the guidelines for the jquery-ui codebase.
Thanks
Jeremy
comment:3 Changed 14 years ago by
This patch is not valid as dialogs are not supposed to be destroyed on close.
comment:4 Changed 14 years ago by
I think I misunderstood the bug. The bug as described here I was unable to reproduce in Safari or Firefox on OS X (Leopard). I created a page with a link that triggers the pop-up using the code provided when clicked, and another link to random page http://some.website.com/. After triggering the pop-up and closing the window, the link to the random page worked fine.
comment:5 Changed 14 years ago by
I can confirm this issue.
Browsers: IE6, IE7 (possibly IE8). Works fine in Mozilla/Webkit derivates.
jQuery version: 1.3.1 Minified jQuery UI version: 1.6rc6 Minified Works fine with jQuery 1.2.6 and UI 1.5
Scenario: Opening a dialog with modal:true and buttons hangs IE6 & IE7
Expected result: A modal dialog is opened with 2 buttons, "Save" and "Cancel".
Actual result: In IE6, I get a quick glimpse of an opening dialog (but without content), and then the browser hangs. In IE7, browser hangs directly. IE CPU/Memory usage increases dramatically.
Code:
jQuery(function($){ $("#dialogDiv").dialog({ modal:true, buttons: { 'Cancel': function(){ $(this).dialog("close"); }, 'Save': function(){ alert("Saving"); } }).show(); }
comment:6 Changed 14 years ago by
Milestone: | 1.7 → 1.8 |
---|
comment:7 Changed 14 years ago by
Owner: | set to scott.gonzalez |
---|---|
Status: | new → assigned |
comment:9 Changed 14 years ago by
Using r2528, the bug still holds.
using html on the page, i do :
$("#dialog-login").dialog({ bgiframe: true, autoOpen: false, modal: true, closeOnEscape: true, buttons: { OK: function() { // some stuff here } } });
then a button is responsible for opening the dialog :
$("#dialog-login").dialog('open');
on IE8, i get a infinite loop before seeing anything.
comment:10 Changed 14 years ago by
it also hangs even if the button is removed.
it doesn't if modal: false
hope this helps
comment:11 Changed 14 years ago by
Milestone: | 1.8 → 1.7.2 |
---|
comment:14 Changed 14 years ago by
This is certainly not fixed in 1.7.2.
Related bug: http://dev.jqueryui.com/ticket/4758
The root cause is the setting 'modal' which creates an overlay which on its turn get assigned a handler for window resize. In IE8 this handler called in an infinite loop.
comment:15 Changed 14 years ago by
This is fixed in 1.7.2. The infinite loop in IE8 is a completely unrelated bug.
comment:16 Changed 13 years ago by
I just fund that this happens to get fixed if I comment this line:
var $overlays = $([]); $.each($.ui.dialog.overlay.instances, function() {
$overlays = $overlays.add(this);
});
maybe this helps, any pointers on how to solve this would be very much appreciated
comment:17 Changed 13 years ago by
then, I:
var $overlays = $([]); // $.each($.ui.dialog.overlay.instances, function() { // $overlays = $overlays.add(this); // }); $overlays = $overlays.add($.ui.dialog.overlay.instances[0]);
but not sure if this will break other stuff. My guess is that in IE6 it starts recurring forever.
comment:18 Changed 12 years ago by
This bug (IE hangs upon opening modal dialog) still occurs in UI v1.8.12, with any version of jQuery (1.4,5,6). Not sure why this is marked fixed.
Tested in IE7, which proceeds to use 100% CPU. Whether a button exists is irrelevant to the problem.
Also see http://stackoverflow.com/questions/5669553/jquery-dialog-ie6-and-ie7-hangs and http://groups.google.com/group/jquery-ui/browse_thread/thread/885cad0360b5fb99
The jsfiddle in the first link also reproduces the problem.
comment:19 Changed 12 years ago by
This works fine if you include the required CSS. See http://jsfiddle.net/sh9qM/2/
You should use the autoOpen: false option instead of closing the dialog immediately after instantiation.