From 1d42be8d85594c04098e740cbd75adaaafc164e5 Mon Sep 17 00:00:00 2001 From: Dimitris - Rafail Katsampas Date: Wed, 10 Dec 2025 18:10:08 +0200 Subject: [PATCH] fix(RootLayout): Close shade cover when topmost popup doesn't need it --- .../layouts/root-layout/root-layout-common.ts | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/core/ui/layouts/root-layout/root-layout-common.ts b/packages/core/ui/layouts/root-layout/root-layout-common.ts index c58aa0bbcf..1df29478e9 100644 --- a/packages/core/ui/layouts/root-layout/root-layout-common.ts +++ b/packages/core/ui/layouts/root-layout/root-layout-common.ts @@ -161,16 +161,20 @@ export class RootLayoutBase extends GridLayout { ); if (this._shadeCover) { - // Update shade cover with the topmost popupView options (if not specifically told to ignore) - if (this._popupViews.length) { - if (!poppedView?.options?.shadeCover?.ignoreShadeRestore) { - const shadeCoverOptions = this._popupViews[this._popupViews.length - 1].options?.shadeCover; - if (shadeCoverOptions) { - toClose.push(this.updateShadeCover(this._shadeCover, shadeCoverOptions)); - } - } + let nextShadeCoverOpts: ShadeCoverOptions; + + // Get the topmost popup view options if any + if (this._popupViews.length && !poppedView?.options?.shadeCover?.ignoreShadeRestore) { + nextShadeCoverOpts = this._popupViews[this._popupViews.length - 1].options?.shadeCover; + } else { + nextShadeCoverOpts = null; + } + + // Update shade cover with the topmost popupView options if any and if not specifically told to ignore + if (nextShadeCoverOpts) { + toClose.push(this.updateShadeCover(this._shadeCover, nextShadeCoverOpts)); } else { - // Remove shade cover animation if this is the last opened popup view + // Remove shade cover animation otherwise toClose.push(this.closeShadeCover(poppedView?.options?.shadeCover)); } }