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
Copy file name to clipboardExpand all lines: docs/rules/accessibility/avoid-both-disabled-and-aria-disabled.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,15 @@ HTML elements with `disabled` are ignored when a screen reader uses tab navigati
9
9
10
10
This linter will raise when both `aria-disabled` and `disabled` are set on HTML elements that natively support `disabled` including `button`, `fieldset`, `input`, `optgroup`, `option`, `select`, and `textarea`.
11
11
12
-
### 👎 Examples of **incorrect** code for this rule:
Copy file name to clipboardExpand all lines: docs/rules/accessibility/iframe-has-title.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,14 @@
4
4
5
5
`<iframe>` should have a unique title attribute that identifies the content. The title will help screen reader users determine whether to explore the frame in detail. If an `<iframe>` contains no meaningful content, hide it by setting `aria-hidden="true"`.
6
6
7
-
### 👎 Examples of **incorrect** code for this rule:
Copy file name to clipboardExpand all lines: docs/rules/accessibility/no-aria-label-misuse-counter.md
+5-8Lines changed: 5 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,24 +6,21 @@ This rule aims to discourage common misuse of the `aria-label` and `aria-labelle
6
6
7
7
### "Help! I'm trying to set a tooltip on a static element and this rule flagged it!"
8
8
9
-
Please do not use tooltips on static elements. It is a highly discouraged, inaccessible pattern for the following reasons:
10
-
11
-
- Static elements are not tab-focusable so keyboard-only users will not be able to access the tooltip at all. (Note: setting `tabindex="0"` to force a generic element to be focusable is not a solution.)
12
-
- It's likely that tooltip is inappropriate for your usecase to begin with. Tooltips are not accessible at all on mobile devices so if you're trying to convey critical information, use something else. Additionally, implementing tooltip as `aria-label` is rarely appropriate and has potential to cause accessibility issues for screen reader users.
13
-
14
-
If you've determined the tooltip content is not critical, simply remove it. If you determine the tooltip content is important to keep, we encourage you to reach out to a design or accessibility team who can assist in finding an alternate, non-tooltip pattern.
9
+
Please do not use tooltips on static elements. It is a highly discouraged, inaccessible pattern.
10
+
See [Primer: Tooltip alternatives](https://primer.style/design/accessibility/tooltip-alternatives) for what to do instead.
15
11
16
12
### Resources
17
13
18
14
-[w3c/aria Consider prohibiting author naming certain roles #833](https://github.com/w3c/aria/issues/833)
19
15
-[Not so short note on aria-label usage - Big Table Edition](https://html5accessibility.com/stuff/2020/11/07/not-so-short-note-on-aria-label-usage-big-table-edition/)
20
16
-[Your tooltips are bogus](https://heydonworks.com/article/your-tooltips-are-bogus/)
There are conflicting resources and opinions on what elements should support these naming attributes. For now, this rule will operate under a relatively simple heuristic aimed to minimize false positives. This may have room for future improvements. Learn more at [W3C Name Calcluation](https://w3c.github.io/aria/#namecalculation).
25
22
26
-
### 👎 Examples of **incorrect** code for this rule:
23
+
### **Incorrect** code for this rule 👎
27
24
28
25
```erb
29
26
<span class="tooltipped" aria-label="This is a tooltip">I am some text.</span>
@@ -41,7 +38,7 @@ There are conflicting resources and opinions on what elements should support the
41
38
<h1 aria-label="This will override the page title completely">Page title</h1>
0 commit comments