From 2f6dd1d9f46e27f5d6b691eb50a26f6006aff6ba Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 3 Jun 2022 08:57:05 +0200 Subject: [PATCH] use href attr for section tabs --- .../backoffice/backoffice-header-sections.element.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/backoffice-header-sections.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/backoffice-header-sections.element.ts index 0765705c49..95172a66ad 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/backoffice-header-sections.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/backoffice-header-sections.element.ts @@ -73,16 +73,13 @@ export class UmbBackofficeHeaderSections extends UmbContextConsumerMixin(LitElem this._open = !this._open; } - private _handleTabClick(e: PointerEvent, section: UmbExtensionManifestSection) { + private _handleTabClick(e: PointerEvent) { const tab = e.currentTarget as HTMLElement; // TODO: we need to be able to prevent the tab from setting the active state if (tab.id === 'moreTab') { return; } - - // TODO: this could maybe be handled by an anchor tag - history.pushState(null, '', `/section/${section.meta.pathname}`); } private _handleLabelClick() { @@ -121,11 +118,11 @@ export class UmbBackofficeHeaderSections extends UmbContextConsumerMixin(LitElem return html` ${this._visibleSections.map( - (section: any) => html` + (section: UmbExtensionManifestSection) => html` + href="${`/section/${section.meta.pathname}`}" + label="${section.name}"> ` )} ${this._renderExtraSections()}