We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
aria-selected
role="option"
1 parent 4e702c8 commit 024dc7eCopy full SHA for 024dc7e
2 files changed
.changeset/slick-walls-retire.md
@@ -0,0 +1,5 @@
1
+---
2
+'@primer/view-components': patch
3
4
+
5
+Always use `aria-selected` for ActionList items with role="option".
app/components/primer/alpha/action_list/item.rb
@@ -302,7 +302,8 @@ def before_render
302
if @list.allows_selection?
303
@content_arguments[:aria] = merge_aria(
304
@content_arguments,
305
- { 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)
306
+ { aria: @list.acts_as_listbox? || @list.aria_selection_variant == :selected ? { selected: active? } : { checked: active? } }
307
)
308
end
309
0 commit comments