Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aria-selected scrollable Listbox Example does not follow best practice #3175

Open
Row opened this issue Nov 20, 2024 · 2 comments
Open

aria-selected scrollable Listbox Example does not follow best practice #3175

Row opened this issue Nov 20, 2024 · 2 comments

Comments

@Row
Copy link

Row commented Nov 20, 2024

The unselected values/options should have aria-selected="false"

https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-scrollable/

According
https://w3c.github.io/aria/#aria-selected

Value Description
false The selectable element is not selected.
true The selectable element is selected.
undefined The element is not selectable.
@JAWS-test
Copy link

According to https://w3c.github.io/aria/#aria-selected and https://w3c.github.io/aria/#option it is not necessary

The option, tab, and treeitem roles permit user agents to provide an implicit value for aria-selected when specified conditions are met.

If a user agent provides an implicit aria-selected value for an option, the value SHOULD be true if the option has DOM focus or the listbox has DOM focus and the option is referenced by aria-activedescendant. Otherwise, if a user agent provides an implicit aria-selected value for an option, the value SHOULD be false

@JAWS-test
Copy link

I agree with you that it is not best practice to omit aria-selected, see w3c/aria#1094

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants