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-visually-hidden-interactive-element](docs/rules/a11y-no-visually-hidden-interactive-element.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-visually-hidden-interactive-element`)
2
+
3
+
💼 This rule is enabled in the ⚛️ `react` config.
4
+
5
+
<!-- end auto-generated rule header -->
6
+
7
+
## Rule Details
8
+
9
+
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.
10
+
11
+
Note: we are not guarding against visually hidden `input` elements at this time. Some visually hidden inputs might cause a false positive (e.g. some file inputs).
12
+
13
+
### Why do we visually hide content?
14
+
15
+
Visually hiding content can be useful when you want to provide information specifically to screen reader users or other assitive technology users while keeping content hidden from sighted users.
16
+
17
+
Applying the following css will visually hide content while still making it accessible to screen reader users.
Copy file name to clipboardExpand all lines: lib/configs/react.js
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ module.exports = {
10
10
rules: {
11
11
'jsx-a11y/role-supports-aria-props': 'off',// Override with github/role-supports-aria-props until https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/910 is resolved
'Avoid visually hidding 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 the hidden element.',
0 commit comments