Opened 10 years ago

Closed 8 years ago

#5523 closed bug (fixed)

Dialog overlay bug for nested dialogs

Reported by: w4x Owned by:
Priority: major Milestone: 1.8.7
Component: ui.dialog Version: 1.8
Keywords: dialog overlay Cc:
Blocked by: Blocking:

Description

info: http://stackoverflow.com/questions/2637327/jquery-ui-modal-dialogs

reproduce: http://jsbin.com/otama Steps to reproduce:

  1. create a dialog (dialog) by clicking on the button
  2. create another dialog (dialogA) by clicking on the "create" button inside first dialog
  3. close dialogA
  4. repeat steps 2-3
  5. overlay of the first dialog has been disappeared

Change History (5)

comment:1 in reply to:  description Changed 9 years ago by watanabe

jQuery UI 1.8 uncompressed version
jquery.ui.dialog.js

Problem:
line 174(dialog destroy), 204(dialog close)

self.overlay.destroy();

line 724(overlay destroy)

this.oldInstances.push(this.instances.splice($.inArray($el, this.instances), 1)[0]);

"duplicate overlay.destroy()" makes "instances & oldInstances in $.ui.dialog.overlay" broken.

Workaround-A: line 724(overlay destroy)

var index = $.inArray($el, this.instances);
if (index >= 0) this.oldInstances.push(this.instances.splice(index, 1)[0]);

Workaround-B: line 204(dialog close)

self.overlay.destroy(); self.overlay = null;

comment:2 Changed 9 years ago by womp

I can duplicate this in 1.8.2. Very frustrating. Thanks for the workaround!

comment:3 Changed 9 years ago by Scott González

Milestone: 1.9

comment:4 Changed 8 years ago by adovenmuehle

Using the latest jQuery UI (1.8.13) this bug appears to be fixed. See http://jsbin.com/otama/38 (Updated the original example to use the latest jQuery UI)

comment:5 Changed 8 years ago by Scott González

Milestone: 1.91.8.7
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.