Closed hornta closed 1 month ago
*Might be related to this old issue from a11y
?
I am not really sure this is valid case. You should use aria-labelledby
when you don't have a label
. For example
<p id="name">Ron</p>
<input aria-labelledby="name">Name</input>
In your case, you're using a solution in the middle, which I have never seen. Can you provide some resource that explain this use case?
Hmm, I'm not sure if I provided you with the incorrect playground example or not. Looking at it now, it doesn't really make sense. I'm closing this.
I'm not sure about it reporting incorrectly (although this is how I discovered this issue on GitHub), but I have gotten some linting results that looked false-positive and tried to disable the rule in biome's config and apparently disabling it does not work.
UPD: This is probably related to this issue in my case.
Environment information
Rule name
a11y/noLabelWithoutControl
Playground link
https://biomejs.dev/playground/?code=PAA%2BAAoAIAAgADwAbABhAGIAZQBsACAAaQBkAD0AIgAxADIAMwAiAD4AQQAgAEwAYQBiAGUAbAA8AC8AbABhAGIAZQBsAD4ACgAgACAAPABpAG4AcAB1AHQAIABhAHIAaQBhAC0AbABhAGIAZQBsAGwAZQBkAGIAeQA9ACIAMQAyADMAIgAgAC8APgAKADwALwA%2BAA%3D%3D
Expected result
Biome shouldn't report a
<label>
with an id because it's probably referenced in aaria-labeledby
attribute in another element which is valid as in the playground example.Code of Conduct