From 4207e0360cc986e7fc716c19b5c9ce5b266b30f9 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 15 Sep 2025 19:56:22 +0200 Subject: [PATCH] Reload section root on repeated header section click (#20141) * Reload section root on repeated header section click Adds logic to reload the root of a section if its header is clicked while already active. This improves navigation consistency by resetting the section view when the user clicks the current section again. * Update backoffice-header-sections.element.ts --- .../components/backoffice-header-sections.element.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts b/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts index 28d8a80778..89c0ffbb51 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts @@ -79,6 +79,13 @@ export class UmbBackofficeHeaderSectionsElement extends UmbLitElement { const clickedSectionAlias = manifest.alias; + // If the clicked section is the same as the current section, we just load the original section path to load the section root + if (this._currentSectionAlias === clickedSectionAlias) { + const sectionPath = this.#getSectionPath(manifest); + history.pushState(null, '', sectionPath); + return; + } + // Check if we have a stored path for the clicked section if (this.#sectionPathMap.has(clickedSectionAlias)) { const storedPath = this.#sectionPathMap.get(clickedSectionAlias);