Skip to content

Commit 52c5279

Browse files
authored
fix(RootLayout): close shade cover when topmost popup doesn't need it (#11007)
1 parent df845bb commit 52c5279

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

packages/core/ui/layouts/root-layout/root-layout-common.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,20 @@ export class RootLayoutBase extends GridLayout {
161161
);
162162

163163
if (this._shadeCover) {
164-
// Update shade cover with the topmost popupView options (if not specifically told to ignore)
165-
if (this._popupViews.length) {
166-
if (!poppedView?.options?.shadeCover?.ignoreShadeRestore) {
167-
const shadeCoverOptions = this._popupViews[this._popupViews.length - 1].options?.shadeCover;
168-
if (shadeCoverOptions) {
169-
toClose.push(this.updateShadeCover(this._shadeCover, shadeCoverOptions));
170-
}
171-
}
164+
let nextShadeCoverOpts: ShadeCoverOptions;
165+
166+
// Get the topmost popup view options if any
167+
if (this._popupViews.length && !poppedView?.options?.shadeCover?.ignoreShadeRestore) {
168+
nextShadeCoverOpts = this._popupViews[this._popupViews.length - 1].options?.shadeCover;
169+
} else {
170+
nextShadeCoverOpts = null;
171+
}
172+
173+
// Update shade cover with the topmost popupView options if any and if not specifically told to ignore
174+
if (nextShadeCoverOpts) {
175+
toClose.push(this.updateShadeCover(this._shadeCover, nextShadeCoverOpts));
172176
} else {
173-
// Remove shade cover animation if this is the last opened popup view
177+
// Remove shade cover animation otherwise
174178
toClose.push(this.closeShadeCover(poppedView?.options?.shadeCover));
175179
}
176180
}

0 commit comments

Comments
 (0)