-
- Notifications
You must be signed in to change notification settings - Fork 641
Closed
Description
The problem
The control-has-associated-label rule currently accepts whitespace as an accessible label. This issue is exaggerated by the use of prettier which may introduce line breaks and other whitespace automatically, defeating the rule.
Examples
All of the below examples lack accessible labels.
<button></button> <!-- rule correctly flags invalid markup --> <button> </button> <!-- rule fails to flag invalid markup --> <button aria-label=""></button> <!-- rule correctly flags invalid markup --> <button aria-label=" "></button> <!-- rule fails to flag invalid markup -->Suggested fix
Update mayHaveAccessibleLabel to .trim() the node's value before asserting truthiness.
Metadata
Metadata
Assignees
Labels
No labels