diff --git a/.changeset/late-bugs-battle.md b/.changeset/late-bugs-battle.md new file mode 100644 index 00000000000..221ffe97559 --- /dev/null +++ b/.changeset/late-bugs-battle.md @@ -0,0 +1,7 @@ +--- +"@primer/react": patch +--- + +Add aria-selected value to ActionList.Item. + + diff --git a/src/ActionList/Item.tsx b/src/ActionList/Item.tsx index e22a2d736b5..90ee1682abf 100644 --- a/src/ActionList/Item.tsx +++ b/src/ActionList/Item.tsx @@ -207,6 +207,7 @@ export const Item = React.forwardRef( ref={forwardedRef} sx={merge(styles, sxProp)} data-variant={variant === 'danger' ? variant : undefined} + aria-selected={containerProps.role === 'option' ? selected : undefined} {...containerProps} {...props} > diff --git a/src/__tests__/ActionList.test.tsx b/src/__tests__/ActionList.test.tsx index 9e990e235ef..ca070d04305 100644 --- a/src/__tests__/ActionList.test.tsx +++ b/src/__tests__/ActionList.test.tsx @@ -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} >