[label-has-associated-control] add button to list of elements that can be associated with a label#991
[label-has-associated-control] add button to list of elements that can be associated with a label#991huynhducduy wants to merge 1 commit intojsx-eslint:mainfrom
button to list of elements that can be associated with a label#991Conversation
|
While that's technically true, what would be the point of putting a label on a button, when you can just put the label contents inside the button? |
The simplest thing I can think of is to make use of the Perhaps we should let this rule follow the spec, and create another rule to disapprove the use of interactive elements like |
|
The spec isn't the important thing to follow here, though - accessibility is. Our linter rules should forbid standard things that don't increase a11y, and should require nonstandard things if they do increase a11y. |
|
Oh, if that is the case, then we have more things to do in this rule as well (as stated in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#accessibility_concerns)
And those should explicitly mentioned in the document as well |
|
Sounds good. |
|
Alright, should I close this PR and open an issue for further discussion, then work on it via a future PR, or can I just keep this PR? |
|
If this PR can be repurposed, that's ideal; if not, close it and file new ones. |
According to Mdn Web Docs,
buttonis one of the elements that can be associated withlabelThis PR add
buttonto the list.