Skip to content

fix: accessibility problem with more button on tablist #1029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/uui-base/lib/utils/drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ export const drag = (
// TouchEvent is not available in Firefox
if ('TouchEvent' in window && event instanceof TouchEvent) {
pointerEvent = event.touches[0];
} else if ( event instanceof PointerEvent ) {
} else if (event instanceof PointerEvent) {
pointerEvent = event;
}
else {
} else {
return;
}

Expand Down
6 changes: 2 additions & 4 deletions packages/uui-tabs/lib/uui-tab-group.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export class UUITabGroupElement extends LitElement {
demandCustomElement(this, 'uui-popover-container');
demandCustomElement(this, 'uui-symbol-more');

if (!this.hasAttribute('role')) this.setAttribute('role', 'tablist');

await this.updateComplete;
this.#resizeObserver.observe(this._mainElement);
}
Expand Down Expand Up @@ -268,7 +266,7 @@ export class UUITabGroupElement extends LitElement {
render() {
return html`
<div id="main">
<div id="grid">
<div id="grid" role="tablist">
<slot @slotchange=${this.#onSlotChange}></slot>
</div>
<uui-button
Expand All @@ -284,7 +282,7 @@ export class UUITabGroupElement extends LitElement {
id="popover-container"
popover
placement="bottom-end">
<div id="hidden-tabs-container">
<div id="hidden-tabs-container" role="tablist">
${repeat(this.#hiddenTabElements, el => html`${el}`)}
</div>
</uui-popover-container>
Expand Down
15 changes: 15 additions & 0 deletions packages/uui-tabs/lib/uui-tabs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ describe('UuiTab', () => {
<uui-tab label="Content">Content</uui-tab>
<uui-tab label="Packages">Packages</uui-tab>
<uui-tab label="Media" active>Media</uui-tab>
<uui-tab label="Content1">Content to force a more button</uui-tab>
<uui-tab label="Content2">Content to force a more button</uui-tab>
<uui-tab label="Content3">Content to force a more button</uui-tab>
<uui-tab label="Content4">Content to force a more button</uui-tab>
<uui-tab label="Content5">Content to force a more button</uui-tab>
<uui-tab label="Content6">Content to force a more button</uui-tab>
<uui-tab label="Content7">Content to force a more button</uui-tab>
<uui-tab label="Content8">Content to force a more button</uui-tab>
<uui-tab label="Content9">Content to force a more button</uui-tab>
<uui-tab label="Content10">Content to force a more button</uui-tab>
<uui-tab label="Content11">Content to force a more button</uui-tab>
<uui-tab label="Content12">Content to force a more button</uui-tab>
<uui-tab label="Content13">Content to force a more button</uui-tab>
<uui-tab label="Content14">Content to force a more button</uui-tab>
<uui-tab label="Content15">Content to force a more button</uui-tab>
</uui-tab-group>
`);

Expand Down
Loading