-
Notifications
You must be signed in to change notification settings - Fork 470
fix: Various implicit roles in ByRole #446
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
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 3d38d1b:
|
Codecov Report
@@ Coverage Diff @@
## master #446 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 22 22
Lines 397 402 +5
Branches 94 95 +1
=====================================
+ Hits 397 402 +5
Continue to review full report at Codecov.
|
767f867
to
7e24d9b
Compare
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.
Looks good to me! Thank you! Just one comment.
Would be better to not have a this released without #408. Then we can add tests with named elements. |
Working on getting this mergable right now. |
7e24d9b
to
29d9b47
Compare
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 good. Just want to make sure aria-query didn't mess us up.
"region: | ||
|
||
Name "": | ||
<section | ||
data-testid="a-section" | ||
/> | ||
|
||
-------------------------------------------------- |
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 change appears to be a result of the aria-query update. Maybe that's a bug?
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.
Super. Thank you!
🎉 This PR is included in version 6.14.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This was a breaking change in my case. If anyone else is having issues with ****ByRole("form") not working anymore, add an ARIA label to your form. return (
- <form onSubmit={ onSubmit }>
+ <form onSubmit={ onSubmit } aria-label="Configuration">
<div id="floatsubmit"> |
Is that form bug something for which an issue should be created? |
I don't think an aria label should be required on the form. This seems like a bug. |
It was an upstream change in aria-query, and it follows the w3c spec. |
Oh, that's very interesting. So a label is required on a form according to the spec? |
Should we bump the major version? The semver spec recommends doing that retroactively after it’s discovered that a breaking change has been already published accidentally. |
It does look that way:
It still feels very weird to me. Other elements (like On a positive note, the label seems to work nicely. And maybe that's the entire idea behind it. A heading and article will make sense due to their content. But selecting a <form aria-labelledby="signup-form">
<h1 id="signup-form">
Signup Form
</h1>
<input placeholder="email" />
</form> screen.getByRole('form', { name: /signup form/i }) |
With #408 we'll be able to correctly identify some of these implicit roles (e.g.
<form>
or<section>
)What:
Fix various issues with implicit roles
Why:
Examples for elements with the wrong implicit role when using
aria-query@3
:<form>
without an accessible name having a role (though even with it now has is not queried by theform
role. this requires feat(byRole): Addname
filter #408)<select>
being identified as bothcombobox
andlistbox
even though it is only acombobox
<input list="" />
not being identified as a comboboxHow:
Bump
aria-query
to^4.0.1
Checklist:
docs site
[ ] I've prepared a PR for types targetingDefinitelyTyped~