-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
false positive a11y warning for label with control inside component #12002
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
Not sure the warning is really that good/necessary anyway. |
I don't think overfiring in this case is a problem...the warning can always be muted manually if you know that there's an input inside the component.
If we want to discuss the usefulness of the error it's another discourse but i think generally better be safe than sorry with warnings especially since you can mute them when you know better than the compiler. |
Muting is a pain though, both for writing and for reading. For entering the mute-comment perhaps it could be made easier by having the mute comment in the warning (so it can be copied and pasted)? For reading, perhaps allow a parenthesized comment in the mute-comment?
Spurious warnings detract from real problems though, so ideally they would be removed. |
That's exactly how it works — the warning code is included (though the details may differ between editors), you can just double-click on it to copy it. Screen.Recording.2024-06-12.at.8.30.46.AM.movFreeform text is allowed after the comma-separated lists of codes to ignore. (There was a conversation elsewhere about whether we should put the freeform text in parens, or after a |
I was thinking more that the entire Perhaps it should be documented at https://svelte.dev/docs/accessibility-warnings ? |
Yeah, Svelte 4 is very loosey-goosey about this stuff: <!-- svelte-ignore all of the following: the a11y-accesskey rule
and the a11y-click-events-have-key-events rule but also the
a11y-no-static-element-interactions rule
(in Svelte 5 we will get a bit stricter about where the codes can go)
-->
<div accessKey="z" on:click />
Agree: #12021 |
Describe the bug
The
a11y_label_has_associated_control
warning yields false positives in the case where the control is inside a component:We should omit the warning if a component exists inside the label.
Reproduction
demo
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: