Don't access hidden tabs via left/right arrow (#25495)

This commit is contained in:
karwosts 2025-05-17 03:43:12 -07:00 committed by GitHub
parent bc15d1474e
commit b61180baa6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -307,18 +307,19 @@ class HUIRoot extends LitElement {
view.visible === false); view.visible === false);
const tabs = html`<sl-tab-group @sl-tab-show=${this._handleViewSelected}> const tabs = html`<sl-tab-group @sl-tab-show=${this._handleViewSelected}>
${views.map( ${views.map((view, index) => {
(view, index) => html` const hidden =
!this._editMode && (view.subview || _isTabHiddenForUser(view));
return html`
<sl-tab <sl-tab
slot="nav" slot="nav"
panel=${index} panel=${index}
.active=${this._curView === index} .active=${this._curView === index}
.disabled=${hidden}
aria-label=${ifDefined(view.title)} aria-label=${ifDefined(view.title)}
class=${classMap({ class=${classMap({
icon: Boolean(view.icon), icon: Boolean(view.icon),
"hide-tab": Boolean( "hide-tab": Boolean(hidden),
!this._editMode && (view.subview || _isTabHiddenForUser(view))
),
})} })}
> >
${this._editMode ${this._editMode
@ -368,8 +369,8 @@ class HUIRoot extends LitElement {
` `
: nothing} : nothing}
</sl-tab> </sl-tab>
` `;
)} })}
</sl-tab-group>`; </sl-tab-group>`;
return html` return html`