label-has-for fails for bound id/label
See original GitHub issueWhen using a dynamic for / id attribute on label / input elements the rule label-has-for
fails.
error: Form label must have associated control (vue-a11y/label-has-for)
<template>
<label :for="_uid">
<input :id="_uid">
</label>
</template>
Expected behaviour: The rule passes.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Creating Bootstrap 4 labels in forms
The label has “for” attribute that is used to bind an input type like textbox by its ID. As you click on the...
Read more >Prometheus: Up & Running - The Swiss Bay
Prometheus does not include failed scrapes in its application logs, ... 7 For batch jobs such as database backups that are tied to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I got it work. The problem that looks like that rule was taken from
react
rules. You can see it in documentation for rule. Name of rule for react.jsx-a11y/label-has-for"
. So what I had to do it to add options for it.I changed
jsx
tovue
andLabel
tolabel
I will probably can open a PR to fix it.It’s worth noting that
eslint-plugin-jsx-a11y
’slabel-has-for
has recently been deprecated and replaced bylabel-has-associated-control
. This plugin should probably follow suit.