Skip to content

Commit 8936687

Browse files
committed
Dialog: Fixed the case where you open two modal dialogs and then close the top dialog and inputs in the first dialog were no longer usable - Fixes #4309.
1 parent fbb9125 commit 8936687

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

ui/ui.dialog.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,17 @@ $.widget("ui.dialog", {
172172
$.ui.dialog.overlay.resize();
173173

174174
self._isOpen = false;
175+
176+
// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
177+
if (self.options.modal) {
178+
var maxZ = 0;
179+
$('.ui-dialog').each(function() {
180+
if (this != self.uiDialog[0]) {
181+
maxZ = Math.max(maxZ, $(this).css('z-index'));
182+
}
183+
});
184+
$.ui.dialog.maxZ = maxZ;
185+
}
175186
},
176187

177188
isOpen: function() {
@@ -572,6 +583,13 @@ $.extend($.ui.dialog.overlay, {
572583
}
573584

574585
$el.remove();
586+
587+
// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
588+
var maxZ = 0;
589+
$.each(this.instances, function() {
590+
maxZ = Math.max(maxZ, this.css('z-index'));
591+
});
592+
this.maxZ = maxZ;
575593
},
576594

577595
height: function() {

0 commit comments

Comments
 (0)