label-has-associated-control error
whtjs opened this issue · comments
i have followed example code that link provide (label-has-associated-control)
but it still making lint error. i think there is some issue
The issue is likely that you also need a for/id relationship between the label and the input; nesting isn't sufficient.
oh so you mean nesting case may can solve some problem but not in my case?
No, I mean that the rule can be configured three ways: nesting only, ID linking only, or both. To be truly accessible, "both" is always required.
oh than i have to try change my .eslintrc
That's one path, but then you're not being fully accessible - some devices only work with nesting, some only with linking, so you must do both to match the spirit of this rule, and to be fully inclusive.
Closing, since it's answered.