Ticket #6645 (closed bug: fixed)

Opened 4 years ago

Last modified 20 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 4 years ago by scott.gonzalez

  • Priority changed from undecided to major
  • Component changed from unfiled to ui.dialog
  • Milestone changed from 1.5 to 1.9

comment:2 Changed 4 years ago by Jay Merrifield

  • Status changed from new to closed
  • Resolution set to fixed

Dialog: Make sure the overlay instance still exists before trying to remove it. Fixes #6645 - Dialog: Missing element not found check in overlay code.

Changeset: dfb35442975a95c91f6c28188fad021714d7098b

comment:3 Changed 4 years ago by scott.gonzalez

  • Summary changed from Missing element not found check in overlay code to Dialog: Missing element not found check in overlay code

comment:4 Changed 4 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.7

comment:5 Changed 4 years ago by scott.gonzalez

#6741 is a duplicate of this ticket.

comment:6 Changed 20 months ago by Sentenryu

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 20 months ago by tj.vantoll

@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.

Note: See TracTickets for help on using tickets.