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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user