Skip to content

label-has-for doesn't report errors if there is no control wrapped inside #16

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

Closed
thomaslombart opened this issue Jun 2, 2020 · 1 comment · Fixed by #27
Closed

label-has-for doesn't report errors if there is no control wrapped inside #16

thomaslombart opened this issue Jun 2, 2020 · 1 comment · Fixed by #27

Comments

@thomaslombart
Copy link

I'm using the accessibility plugin, especially the rule label-has-for. My configuration looks like the following:

    'vuejs-accessibility/label-has-for': [
      'error',
      { required: { some: ['nesting', 'id'] } },
    ],

The problem is that the rule doesn't fire when I use it like that:

<label>
  <div></div>
</label>

It only fires when there is no elements in it:

<label></label>

II think the nesting validation rule is broken. I took a look at the implementation and I think this line is incomplete. It should check if there is a form control inside the children 🙂

@kddnewton
Copy link
Collaborator

Thanks @thomlom! The linked PR will close this and then I'll release a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants