#6645 closed bug (fixed)
Dialog: Missing element not found check in overlay code
Reported by: | fracmak | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.8.7 |
Component: | ui.dialog | Version: | 1.8.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When destroying an overlay (in the jquery.ui.dialog.js), the inArray() function is never checked under the circumstance that the element is no longer in the local instances array. This can cause problems with overlays being prematurely removed. I've sub
This can be triggered by having a dialog open already, then opening a dialog as follows:
var dialog = jQuery(html).dialog(); dialog.dialog("option", "close", function(){
dialog.remove();
});
When the dialog is closed, the destroy is called, when the close callback happens, the .remove() triggers the destroy to be called a second time.
Change History (7)
comment:1 Changed 12 years ago by
Component: | unfiled → ui.dialog |
---|---|
Milestone: | 1.5 → 1.9 |
Priority: | undecided → major |
comment:2 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 Changed 12 years ago by
Summary: | Missing element not found check in overlay code → Dialog: Missing element not found check in overlay code |
---|
comment:4 Changed 12 years ago by
Milestone: | 1.9 → 1.8.7 |
---|
comment:6 Changed 10 years ago by
Please take a look on this jsfidle (took from #6741): http://jsbin.com/iniyo4
the problem persists when you close the third dialog with ESC, the first one is closed too, the second one doesn't respond to ESC.
comment:7 Changed 10 years ago by
@Sentenryu You seem to be describing an issue separate from the one this ticket was created with and the test case is using a really old version of jQuery UI.
Could you check whether the issue still occurs in the most recent version of jQuery UI and if so create another ticket. To get started, you can use this boilerplate: http://jsfiddle.net/ZgAqH/ Open the link and click to "Fork" (in the top menu) to get started.
Dialog: Make sure the overlay instance still exists before trying to remove it. Fixes #6645 - Dialog: Missing element not found check in overlay code.