diff --git a/.changeset/slick-walls-retire.md b/.changeset/slick-walls-retire.md new file mode 100644 index 0000000000..87bef48f24 --- /dev/null +++ b/.changeset/slick-walls-retire.md @@ -0,0 +1,5 @@ +--- +'@primer/view-components': patch +--- + +Always use `aria-selected` for ActionList items with role="option". diff --git a/app/components/primer/alpha/action_list/item.rb b/app/components/primer/alpha/action_list/item.rb index 7d47bda908..8166386fb4 100644 --- a/app/components/primer/alpha/action_list/item.rb +++ b/app/components/primer/alpha/action_list/item.rb @@ -302,7 +302,8 @@ def before_render if @list.allows_selection? @content_arguments[:aria] = merge_aria( @content_arguments, - { aria: @list.aria_selection_variant == :selected ? { selected: active? } : { checked: active? } } + # Always use aria-selected for listbox (role="option" requires aria-selected per WAI-ARIA 1.2) + { aria: @list.acts_as_listbox? || @list.aria_selection_variant == :selected ? { selected: active? } : { checked: active? } } ) end