Skip to content

Commit

Permalink
fix: added role option to selectabletag and changed stories (#17110)
Browse files Browse the repository at this point in the history
* fix: added role option to selectabletag and changed stories

* fix: added aria-pressed instead of aria-selected

* test: fixed avt test that was failing

* fix: fixed selectalbe tag

---------

Co-authored-by: kennylam <909118+kennylam@users.noreply.github.com>
  • Loading branch information
guidari and kennylam authored Aug 9, 2024
1 parent 76ebd21 commit 5172f69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ test.describe('@avt ProgressIndicator', () => {
},
});
// Testing the first element interaction
await page.keyboard.press('Tab');
await expect(page.getByRole('button', { name: 'Click me' })).toBeVisible();
await page.keyboard.press('Tab');
await expect(page.getByRole('button', { name: 'Click me' })).toBeFocused();

await page.keyboard.press('Enter');
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Tag/SelectableTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const SelectableTag = <T extends React.ElementType>({
leaveDelayMs={0}
onMouseEnter={() => false}>
<Tag
aria-pressed={selectedTag}
ref={tagRef}
slug={slug}
size={size}
Expand All @@ -138,6 +139,7 @@ const SelectableTag = <T extends React.ElementType>({

return (
<Tag
aria-pressed={selectedTag}
ref={tagRef}
slug={slug}
size={size}
Expand Down

0 comments on commit 5172f69

Please sign in to comment.