Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/slick-walls-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

Always use `aria-selected` for ActionList items with role="option".
3 changes: 2 additions & 1 deletion app/components/primer/alpha/action_list/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading