Skip to content

Commit acfda4b

Browse files
committed
Dialog: Fix stacking of modal dialog overlays
Fixes #10138 Closes gh-1286
1 parent ffe60e3 commit acfda4b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ui/dialog.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,14 @@ return $.widget( "ui.dialog", {
260260
this._position();
261261
this._createOverlay();
262262
this._moveToTop( null, true );
263+
264+
// Ensure the overlay is moved to the top with the dialog, but only when
265+
// opening. The overlay shouldn't move after the dialog is open so that
266+
// modeless dialogs opened after the modal dialog stack properly.
267+
if ( this.overlay ) {
268+
this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
269+
}
270+
263271
this._show( this.uiDialog, this.options.show, function() {
264272
that._focusTabbable();
265273
that._trigger( "focus" );

0 commit comments

Comments
 (0)