From 9bc5ab33d2c203bac4d0ee4823a67f0dcb4edaf5 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 24 Oct 2024 10:42:16 +0200 Subject: [PATCH] Workaround: Ignore discard changes when in a workspace modal (#2481) ignore discard changes when in a workspace modal --- .../workspace/entity-detail/entity-detail-workspace-base.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts index 4a85b64773..e98b1c527a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts @@ -196,6 +196,12 @@ export abstract class UmbEntityDetailWorkspaceContextBase< #onWillNavigate = async (e: CustomEvent) => { const newUrl = e.detail.url; + /* TODO: temp removal of discard changes in workspace modals. + The modal closes before the discard changes dialog is resolved.*/ + if (newUrl.includes('/modal/umb-modal-workspace/')) { + return true; + } + if (this._checkWillNavigateAway(newUrl) && this._data.getHasUnpersistedChanges()) { e.preventDefault(); const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);