You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 --><buttonaria-label=""></button><!-- rule correctly flags invalid markup --><buttonaria-label=""></button><!-- rule fails to flag invalid markup -->
Suggested fix
Update mayHaveAccessibleLabel to .trim() the node's value before asserting truthiness.
The text was updated successfully, but these errors were encountered:
The problem
The
control-has-associated-label
rule currently accepts whitespace as an accessible label. This issue is exaggerated by the use ofprettier
which may introduce line breaks and other whitespace automatically, defeating the rule.Examples
All of the below examples lack accessible labels.
Suggested fix
Update
mayHaveAccessibleLabel
to.trim()
the node's value before asserting truthiness.The text was updated successfully, but these errors were encountered: