From 4dc0b74601a8d1ac1e4e897548096584bbeff270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Thu, 8 Feb 2024 14:09:18 +0100 Subject: [PATCH] include active path as well --- .../src/shared/router/route.context.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/shared/router/route.context.ts b/src/Umbraco.Web.UI.Client/src/shared/router/route.context.ts index 3919d638f3..d5a118c0a3 100644 --- a/src/Umbraco.Web.UI.Client/src/shared/router/route.context.ts +++ b/src/Umbraco.Web.UI.Client/src/shared/router/route.context.ts @@ -72,15 +72,10 @@ export class UmbRouteContext extends UmbBaseController { } #removeModalPath(info: IRoutingInfo) { - /* - NOTICE: - This piece of code remove the last occurrence of the modal path from the current url. - This means if the same type of modal is opened multiple times, the url will be cleaned from the last opened modal. - This is okay for now as we do not have any situations where we close a parent modal before a child modal. - */ + // Reset the URL to the routerBasePath const folderToRemove = info.match.match.input; if (folderToRemove && window.location.href.includes(folderToRemove)) { - window.history.pushState({}, '', this.#routerBasePath); + window.history.pushState({}, '', this.#routerBasePath + '/' + this.#routerActiveLocalPath); } }