Workaround: Ignore discard changes when in a workspace modal (#2481)

ignore discard changes when in a workspace modal
This commit is contained in:
Mads Rasmussen
2024-10-24 10:42:16 +02:00
committed by GitHub
parent 59d4f8852c
commit 9bc5ab33d2

View File

@@ -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);