diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts index 7fda170903..f8f15291d4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts @@ -123,7 +123,7 @@ export class UmbRouteContext extends UmbContextBase { if (this.#activeModalPath) { // If if there is a modal using the old path. const activeModal = this.#modalRegistrations.find((registration) => { - return registration.generateModalPath() === this.#activeModalPath; + return '/' + registration.generateModalPath() === this.#activeModalPath; }); if (activeModal) { this.#modalContext?.close(activeModal.key); diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot.element.ts index e2bc6353c9..a78f0e2ac6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot.element.ts @@ -122,7 +122,7 @@ export class UmbRouterSlotElement extends UmbLitElement { this.dispatchEvent(new UmbRouterSlotChangeEvent()); } } else if (event.detail.slot === this.#modalRouter) { - const newActiveModalLocalPath = this.#modalRouter.match?.fragments.consumed ?? ''; + const newActiveModalLocalPath = this.#modalRouter.match?.route.path ?? ''; this.#routeContext._internal_modalRouterChanged(newActiveModalLocalPath); } };