fix(design-system): avoid hidden preview tab stops

Signed-off-by: Arjun Mahanti <arjun@squareup.com>
This commit is contained in:
Arjun Mahanti
2026-09-09 10:36:52 -07:00
parent 76525c9bdb
commit 4c89a709e8
2 changed files with 7 additions and 1 deletions

View File

@@ -18,7 +18,12 @@ function ChromePill() {
<Tabs.Indicator />
</Tabs.List>
{items.map((label) => (
<Tabs.Panel key={label} value={label} className="bui-sr-only">
<Tabs.Panel
key={label}
value={label}
tabIndex={-1}
className="bui-sr-only"
>
{label} surface selected in this material preview.
</Tabs.Panel>
))}

View File

@@ -70,6 +70,7 @@ test("Glass navigation shares selection motion and keyboard semantics", async ({
await page.goto("/design/glass");
const tabs = page.getByRole("tablist", { name: "Glass navigation preview" });
const indicator = tabs.locator(".bui-tab-indicator");
await expect(page.getByRole("tabpanel")).toHaveAttribute("tabindex", "-1");
await expect(
tabs.getByRole("tab", { name: "Messages", exact: true }),
).toHaveAttribute("aria-selected", "true");