-
Notifications
You must be signed in to change notification settings - Fork 471
support {checked: true}
for checkbox / radio
#692
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
support {checked: true}
for checkbox / radio
#692
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0bfd8e1:
|
Codecov Report
@@ Coverage Diff @@
## master #692 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 603 614 +11
Branches 151 156 +5
=========================================
+ Hits 603 614 +11
Continue to review full report at Codecov.
|
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.
This is fine with me, though I'd like to hear other's opinions.
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.
Referencing #691 (comment) to make it clear that it we haven't decided whether the problem in the linked issue is something we should solve.
a7432f1
to
4de1412
Compare
{selected: true}
for checkbox / radio{checked: true}
for checkbox / radio
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.
Now that I think about it: How is mixed
treated? Right now we're treating it like selected
but selected
only has two states while checked
has three: true, false and mixed (or indeterminated): https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/checkbox_role
Good point.
Also from the spec:
So I don't really know how to move forward.. |
Another point: the spec uses "positive selection" and "negative selection" when describing |
How is |
From what I went over (
There's no direct "mapping", but from how I understand it should map like so:
So when using This discussion makes me lean more towards |
-- https://www.w3.org/TR/html-aam-1.0/#details-id-56 So |
@all-contributors please add @idanen for code and tests |
I've put up a pull request to add @idanen! 🎉 |
Thanks so much for your help! I've added you as a collaborator on the project. Please make sure that you review the |
🎉 This PR is included in version 7.21.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Hat tip to Sebastian Silbermann for his prior work on PR testing-library#692
Hat tip to Sebastian Silbermann for his prior work on PR #692
Closes #691
What:
Allow querying checkboxes and radios that are checked using the
selected
option inByRole
queries.Why:
Better experience than filtering for them
How:
Checking for both
aria-selected
andchecked
property.Checklist:
docs site