Compare commits

...
Author SHA1 Message Date
Maarten Lakerveld ff773e3045 Put the mobile tab bar after the page content in focus order
On narrow screens the subpage tabs sit at the bottom of the screen but
came before the content in the DOM, so keyboard and screen reader focus
jumped from the header to the bottom bar and back up. Render the bottom
bar after the content and FAB so focus follows the visual order.

Both tab bars are now a labelled nav landmark, so screen reader users
can still jump straight to the tabs without going through long lists.

fixes #14117
2026-11-19 11:40:05 +01:00
2 changed files with 20 additions and 8 deletions

No files matched your search

+18 -7
View File
@@ -233,7 +233,12 @@ export class HassTabsSubpage extends LitElement {
}
${
this.showTabs && !this._narrow
? html`<div id="tabbar">${tabs}</div>`
? html`<nav
id="tabbar"
aria-label=${localize("ui.common.subpage_tabs")}
>
${tabs}
</nav>`
: ""
}
<div id="toolbar-icon">
@@ -241,11 +246,6 @@ export class HassTabsSubpage extends LitElement {
</div>
</div>
</slot>
${
this.showTabs && this._narrow
? html`<div id="tabbar" class="bottom-bar">${tabs}</div>`
: ""
}
</div>
<div class="container">
${
@@ -271,6 +271,17 @@ export class HassTabsSubpage extends LitElement {
<div id="fab">
<slot name="fab"></slot>
</div>
${
this.showTabs && this._narrow
? html`<nav
id="tabbar"
class="bottom-bar"
aria-label=${localize("ui.common.subpage_tabs")}
>
${tabs}
</nav>`
: nothing
}
`;
}
@@ -401,7 +412,7 @@ export class HassTabsSubpage extends LitElement {
:host([narrow]) .toolbar-content {
padding: 4px;
}
.toolbar a {
#tabbar a {
color: var(--sidebar-text-color);
text-decoration: none;
}
+2 -1
View File
@@ -542,7 +542,8 @@
"markdown": "Markdown",
"none": "None",
"first": "First",
"last": "Last"
"last": "Last",
"subpage_tabs": "Pages"
},
"components": {
"safe_area_tool": {