-
Notifications
You must be signed in to change notification settings - Fork 471
Passing { selected: true }
to getByRole
of a radio / checkbox throws an error
#691
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
Comments
The example for tab is in the *ByRole docs |
Why is a checked checkbox considered selected? As far as I know these are two different concepts. |
They differ in the spec. The context might make the difference. <label><input type="checkbox" value="onion" />Onion</label>
<label><input type="checkbox" value="tomato" />Tomato</label>
<label><input type="checkbox" value="lettuce" />Lettuce</label>
<label><input type="checkbox" value="pickles" />Pickles</label> getting all selected options sounds fit. <label><input type="checkbox" value"yes" />Take away</label> getting the |
There should be a stronger argument that it "sounds fit" to you. What are screen readers announcing? What does the spec say? etc. There's most likely a reason why we have If you want to implement a |
The argument regarding "sounds fit" was for English, not the spec 😊 In case this library needs to be perfectly aligned with the WAI-ARIA spec, I guess there's no choice other than using |
That'd be great, thanks! |
I was trying to check VoiceOver for what is used in my native tongue (Hebrew). |
🎉 This issue has been resolved in version 7.21.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Describe the feature you'd like:
Currently trying to find checked radio / checkbox throws an error
"aria-selected" is not supported on role "radio".
I'd expect it to work for natively selected elements.
Suggested implementation:
Just try to find by checked first.
Describe alternatives you've considered:
Currently to get those, we need to
filter
agetAllBy*
query:Teachability, Documentation, Adoption, Migration Strategy:
The WAI-ARIA spec separates
aria-checked
fromaria-selected
so maybe we can introduce this change too.Or just update the docs to link to both.
Suggested tab example after implementing the change:
The text was updated successfully, but these errors were encountered: