Skip to content

Rule to warn about aria-label on static elements #1575

Description

@cycomachead

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.

Metadata

Metadata

Assignees

Labels

help wantedWe welcome PRs or discussions for issues marked as help wantedrulesIssue or false result from an axe-core rule

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions