-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix: add a11y configuration for checking through control and input component #7774
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
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.
How about adding a test for <svelte:component> as well?
308bad6 to
445f8b1
Compare
cdb1266 to
80e7556
Compare
dummdidumm
left a comment
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.
Code looks good to me and I would be in favor of merging, though I want to wait on the opinion of other maintainers here since it's a first / gives precedence for other such rule options.
|
@dummdidumm is attempting to deploy a commit to the Svelte Team on Vercel. A member of the Team first needs to authorize it. |
|
|
||
| - `labelComponents` is a list of Svelte component names that should be checked for an associated control. | ||
| - `controlComponents` is a list of Svelte component names that will output an input element. | ||
| - `depth` (default 3, max 25) is an integer that determines how deep within the label element the rule should look for an element to determine if the label element has associated control. |
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.
previously the depth was unlimited. Are we confident with 3 being a right number which doesn't turn up false positives for people previously having no warning?
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.
i would say it's a safe enough number, or what number would u suggest?
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.
If I were to design this from scratch I'd also take 3, it's more about people not seing a warning now which they previously didn't. But having such a deeply nested input is probably super rare. Maybe I'd go with 5.
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.
sure, i dont have a strong opinion on any number
1ad4c45 to
b66934e
Compare
|
Not merging for v3 or v4 to give us room to think about the whole thing more deeply for v5 |
|
Hey, is there a reason this PR isn't merged yet? I feel that it would be very useful in situations where inputs need custom input validation or functionality. |
|
In Svelte 5, we skip the warning if a label contains a snippet or a component, since they could contain a control. As such I'll close this |
Fixes #6469
Before submitting the PR, please make sure you do the following
[feat],[fix],[chore], or[docs].Tests
npm testand lint the project withnpm run lint