question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule to warn about aria-label on static elements

See original GitHub issue

Expectation: I think a new rule to warn about aria-label on static elements would be welcome.

https://developer.paciellogroup.com/blog/2017/07/short-note-on-aria-label-aria-labelledby-and-aria-describedby/ as one example of the rules to follow.

Actual: New rule, so nothing happens yet.

Motivation: This tripped me up when starting out – it’s not obvious that aria-label will not override the text in an element. It some cases it’s easier to add aria-label than to add an additional element with sr-only, and I didn’t find it intuitive as to why that’d be better.

Additionally, at least VO (Mac / iOS) does respect the aria-label as the label that’s read, so it’s not a consistently implemented rule and can be missed in testing.

I think an especially common case for this is with something like icon fonts. <i class="fa fa-cog" aria-label="Settings"></i> seems like an intuitive thing to do.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cycomacheadcommented, May 25, 2019

Sure, I’ll try to give it a go soon!

1reaction
WilcoFierscommented, May 24, 2019

Good idea. Seems like a good best-practice rule. Are you interested in writing the rule?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using ARIA - W3C
2.5 Fifth Rule of ARIA Use. All interactive elements must have an accessible name. An interactive element only has an accessible name when...
Read more >
What happens when aria-label, aria-labelledby and aria ...
JAWS ignores the aria-label or aria-labelledby . If the role is a static role then aria-label will be ignored by all screen readers...
Read more >
aria-label - Accessibility - MDN Web Docs
The aria-label attribute defines a string value that labels an interactive element.
Read more >
"aria-label" or "aria-labelledby" attributes should be used to ...
If a page contains multiple <nav> or <aside> elements, each one should have an aria-label or aria-labelledby attribute so that they can be...
Read more >
What can aria-label be used on? - Stack Overflow
You should generally not use aria-label on static content. It's only intended to be used on interactive elements and some sectioning ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found