WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: [EXTERNAL]Exposing the selected state of buttons

for

From: glen walker
Date: Dec 9, 2019 8:47AM


Whether one works better than the other (aria-selected vs aria-pressed),
make sure you understand which attribute is allowed based on the role of
the element.

https://www.w3.org/TR/html53/dom.html#allowed-aria-roles-states-and-properties

As Patrick alluded to in the first response to this question last month, he
originally said aria-selected but then quickly fixed that to aria-pressed.
If you look at the table in the URL given above and navigate down to the
"button" row, you'll see aria-expanded and aria-pressed (in addition to
global ARIA attributes) are the only ones allowed on a button.

As far as which browser/screen reader combinations it works on, absolutely
follow Birkir's advice and file issues if it doesn't work.