Skip to content

Commit 413e2b5

Browse files
author
Jonny Muir
committed
fix: add role attribute to tablist elements for accessibility
1 parent 338ca32 commit 413e2b5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/uui-tabs/lib/uui-tab-group.element.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ export class UUITabGroupElement extends LitElement {
7777
demandCustomElement(this, 'uui-popover-container');
7878
demandCustomElement(this, 'uui-symbol-more');
7979

80-
if (!this.hasAttribute('role')) this.setAttribute('role', 'tablist');
81-
8280
await this.updateComplete;
8381
this.#resizeObserver.observe(this._mainElement);
8482
}
@@ -268,7 +266,7 @@ export class UUITabGroupElement extends LitElement {
268266
render() {
269267
return html`
270268
<div id="main">
271-
<div id="grid">
269+
<div id="grid" role="tablist">
272270
<slot @slotchange=${this.#onSlotChange}></slot>
273271
</div>
274272
<uui-button
@@ -284,7 +282,7 @@ export class UUITabGroupElement extends LitElement {
284282
id="popover-container"
285283
popover
286284
placement="bottom-end">
287-
<div id="hidden-tabs-container">
285+
<div id="hidden-tabs-container" role="tablist">
288286
${repeat(this.#hiddenTabElements, el => html`${el}`)}
289287
</div>
290288
</uui-popover-container>

0 commit comments

Comments
 (0)