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
|[a11y-aria-label-is-well-formatted](docs/rules/a11y-aria-label-is-well-formatted.md)|[aria-label] text should be formatted as you would visual text. | ⚛️ |||
88
-
|[a11y-no-generic-link-text](docs/rules/a11y-no-generic-link-text.md)| disallow generic link text ||| ❌ |
89
-
|[array-foreach](docs/rules/array-foreach.md)| enforce `for..of` loops over `Array.forEach`| ✅ |||
|[require-passive-events](docs/rules/require-passive-events.md)| enforce marking high frequency event handlers as passive | 🔍 |||
106
-
|[role-supports-aria-props](docs/rules/role-supports-aria-props.md)| Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | ⚛️ |||
107
-
|[unescaped-html-literal](docs/rules/unescaped-html-literal.md)| disallow unescaped HTML literals | 🔍 |||
|[a11y-aria-label-is-well-formatted](docs/rules/a11y-aria-label-is-well-formatted.md)|[aria-label] text should be formatted as you would visual text. | ⚛️ |||
88
+
|[a11y-no-generic-link-text](docs/rules/a11y-no-generic-link-text.md)| disallow generic link text ||| ❌ |
89
+
|[a11y-no-sr-only-class-when-focusable](docs/rules/a11y-no-sr-only-class-when-focusable.md)| Ensures that interactive elements are not visually hidden ||||
90
+
|[array-foreach](docs/rules/array-foreach.md)| enforce `for..of` loops over `Array.forEach`| ✅ |||
|[require-passive-events](docs/rules/require-passive-events.md)| enforce marking high frequency event handlers as passive | 🔍 |||
107
+
|[role-supports-aria-props](docs/rules/role-supports-aria-props.md)| Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | ⚛️ |||
108
+
|[unescaped-html-literal](docs/rules/unescaped-html-literal.md)| disallow unescaped HTML literals | 🔍 |||
# Ensures that interactive elements are not visually hidden (`github/a11y-no-sr-only-class-when-focusable`)
2
+
3
+
<!-- end auto-generated rule header -->
4
+
5
+
## Rule Details
6
+
7
+
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.
'Avoid adding the "sr-only" class to interactive elements. Visually hiding interactive elements can be confusing to sighted keyboard users as it appears their focus has been lost when they navigate to an sr-only element.',
'Avoid adding the "sr-only" class to interactive elements. Visually hiding interactive elements can be confusing to sighted keyboard users as it appears their focus has been lost when they navigate to an sr-only element.'
0 commit comments