Cherry picked Prevent Section URL Retention fix

This commit is contained in:
Niels Lyngsø
2025-10-29 20:03:18 +01:00
parent 393179d8a1
commit e315ae3ae1
2 changed files with 4 additions and 2 deletions

View File

@@ -78,8 +78,9 @@ 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) {
// If preventUrlRetention is set to true then go to the section root.
// Or if the clicked section is the current active one, then navigate to the section root
if (manifest?.meta.preventUrlRetention === true || this._currentSectionAlias === clickedSectionAlias) {
const sectionPath = this.#getSectionPath(manifest);
history.pushState(null, '', sectionPath);
return;

View File

@@ -12,4 +12,5 @@ export interface ManifestSection
export interface MetaSection {
label: string;
pathname: string;
preventUrlRetention?: boolean;
}