Skip to content
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

False Negative with Textarea #470

Closed
KevinHerklotz opened this issue Aug 5, 2018 · 5 comments
Closed

False Negative with Textarea #470

KevinHerklotz opened this issue Aug 5, 2018 · 5 comments

Comments

@KevinHerklotz
Copy link

In my React component I have the following textarea with a label surrounding it:

<label htmlFor="myTextarea">My Textarea:
    <textarea name="myTextarea" id="myTextarea" />
</label>

I am using airbnb rules which are:

'jsx-a11y/label-has-for': ['error', {
      components: [],
      required: {
          every: ['nesting', 'id'],
      },
      allowChildren: false,
  }],

I'm getting the following error:

Form label must have ALL of the following types of associated control: nesting, id

... but I'm expecting no error.

I'm using eslint-plugin-jsx-a11y version 6.1.1 and eslint version 5.3.0

@ljharb
Copy link
Member

ljharb commented Aug 5, 2018

This is definitely a bug.

@rpellerin
Copy link

Experiencing this as well for a nested
image

@ljharb
Copy link
Member

ljharb commented Aug 22, 2018

@rpellerin if you’re using airbnb’s config, you also need to link them with for/id. If not. Please file a new issue.

@rijulg
Copy link

rijulg commented Oct 2, 2018

@ljharb When can we start using this fix? I believe it's not there in 6.1.1 and there's no later version available on npm

@ljharb
Copy link
Member

ljharb commented Oct 7, 2018

@rijulg try v6.1.2

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

No branches or pull requests

4 participants