Implement the GitHub::Accessibility::NoVisuallyHiddenInteractiveElements rule from erblint-github.
Rule Details
This rule guards against visually hiding interactive elements. If a sighted keyboard user navigates to an interactive element that is visually hidden they might become confused and assume that keyboard focus has been lost.
Note: input elements are not flagged at this time as some visually hidden inputs might cause false positives (e.g. file inputs).
Examples
Incorrect code for this rule:
<button class="sr-only">Submit</button>
Correct code for this rule:
<h2 class="sr-only">Welcome to GitHub</h2>
References
Parent Issue
Implement the
GitHub::Accessibility::NoVisuallyHiddenInteractiveElementsrule fromerblint-github.Rule Details
This rule guards against visually hiding interactive elements. If a sighted keyboard user navigates to an interactive element that is visually hidden they might become confused and assume that keyboard focus has been lost.
Note:
inputelements are not flagged at this time as some visually hidden inputs might cause false positives (e.g. file inputs).Examples
Incorrect code for this rule:
Correct code for this rule:
References
Parent Issue
erblint-githubcompatibility/parity #1205