diff --git a/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.data.ts b/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.data.ts index b1455d7598..491d0c9a31 100644 --- a/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.data.ts +++ b/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.data.ts @@ -97,7 +97,8 @@ export const data: Array = [ alias: 'multiNodeTreePicker', culture: null, segment: null, - value: null, + value: + 'all-property-editors-document-id,c05da24d-7740-447b-9cdc-bd8ce2172e38,fd56a0b5-01a0-4da2-b428-52773bfa9cc4', }, { alias: 'datePicker', 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 4ccf9d156a..5b0d53c85b 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,8 +72,17 @@ export class UmbRouteContext extends UmbBaseController { } #removeModalPath(info: IRoutingInfo) { - if (window.location.href.includes(info.match.fragments.consumed)) { - window.history.pushState({}, '', window.location.href.split(info.match.fragments.consumed)[0]); + /* + 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. + */ + const currentUrl = window.location.href; + const folderToRemove = info.match.fragments.consumed; + if (currentUrl.includes(folderToRemove)) { + const split = currentUrl.split(folderToRemove); + window.history.pushState({}, '', split[split.length - 1]); } } diff --git a/src/Umbraco.Web.UI.Client/src/shared/router/router-slot.element.ts b/src/Umbraco.Web.UI.Client/src/shared/router/router-slot.element.ts index 97bdd8aed2..f8c09e1dbd 100644 --- a/src/Umbraco.Web.UI.Client/src/shared/router/router-slot.element.ts +++ b/src/Umbraco.Web.UI.Client/src/shared/router/router-slot.element.ts @@ -103,7 +103,6 @@ export class UmbRouterSlotElement extends UmbLitElement { const newActiveLocalPath = this.#router.match?.route.path; if (this._activeLocalPath !== newActiveLocalPath) { - console.log('update', newActiveLocalPath); this._activeLocalPath = newActiveLocalPath; this.#routeContext._internal_routerGotActiveLocalPath(this._activeLocalPath); this.dispatchEvent(new UmbRouterSlotChangeEvent());