Skip to content
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

Add aria-selected value to ActionList.Item. #3579

Merged
merged 8 commits into from
Aug 16, 2023
Merged
7 changes: 7 additions & 0 deletions .changeset/late-bugs-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@primer/react": patch
---

Add aria-selected value to ActionList.Item.

<!-- Changed components: ActionList -->
1 change: 1 addition & 0 deletions src/ActionList/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
ref={forwardedRef}
sx={merge<BetterSystemStyleObject>(styles, sxProp)}
data-variant={variant === 'danger' ? variant : undefined}
aria-selected={containerProps.role === 'option' ? selected : undefined}
{...containerProps}
{...props}
>
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/ActionList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function SingleSelectListStory(): JSX.Element {
key={index}
role="option"
selected={index === selectedIndex}
aria-selected={index === selectedIndex}
onSelect={() => setSelectedIndex(index)}
disabled={project.disabled}
>
Expand Down
Loading