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
This commit is contained in:
Mads Rasmussen
2025-09-15 19:56:22 +02:00
committed by GitHub
parent cbf5665f15
commit 4207e0360c

View File

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