-
Notifications
You must be signed in to change notification settings - Fork 538
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
Add aria-selected value to ActionList.Item. #3579
Conversation
🦋 Changeset detectedLatest commit: 25ef26b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
FYI: I was just running tests with the new primer action and used this PR to test its integration with github/github and all checks are passing 🤩 https://github.com/github/github/pull/283677 |
I noticed while looking at this issue during a pairing session that the example: https://primer-9eeb77613b-13348165.drafts.github.io/storybook/?path=/story/components-actionlist-examples--async-list-with-spinner isn't adding the |
@owenniblock I don't think the |
@radglob you are right! Sorry for the confusion. I'm slightly confused by the HTML specs not saying that options are valid inside a listbox but only valid inside select, datalist or optgroup elements and yet the WAI ARIA listbox examples behave as we plan to do stuff here. I'm going to do a bit more research here to try and work out why there's a discrepancy between these two documents. EDIT: https://w3c.github.io/aria/#listbox states:
Aha! This is OK because:
So We should consider removing the |
@owenniblock I think we still need that. In this case, |
@radglob I was just about to post to say sorry 😂 I totally misread what that code was going (I just went over the code in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! Just left a small comment for clarity, also wanted to ask if you could add a test case for this scenario? Would help a ton to make sure we don't regress in the future 🙏
Co-authored-by: Josh Black <[email protected]>
By adding
aria-selected
to the<li role="option">
tags, NVDA and other screen readers will now announce that an option is "not selected" whenaria-selected=false
.From what I've read, it is not the normal function of NVDA or JAWS to announce that an option is selected. Silence is the default behavior. https://stackoverflow.com/questions/71468332/select2-li-aria-selected-true-is-not-read-as-selected-by-screen-reader
Without
aria-selected
, state will not be announced for any option.Closes https://github.com/github/accessibility-audits/issues/4484.
Screenshots
Please provide before/after screenshots for any visual changes
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.