-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(aria-label): new rule to flag incorrect use of aria-label, aria-labelledby, and aria-describeby #2712
Conversation
"description": "Ensure aria-label(ledby) is only used on non-static elements", | ||
"help": "Use aria-label, aria-labelledby, and aria-describedby on elements with non-static roles" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see some test data on this. What is the problem we are solving with this rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to need to run this rule by the JC. Can you do some testing for this to show what the problem is that comes from this? I suspect we're going to get complaints about this one.
I think this PR is not needed and we should instead use the Prohibited States and Props from ARIA 1.2 as they cover this exact use case but in a more generic way. Related discussions: |
Note, this may not work with the |
From Scott O'Hara on asking about HTML elements with no role mapping:
|
Tested the following DOM in different browsers: <div aria-label="my label">foo</div>
<span aria-label="my label">foo</span>
<i aria-label="my label">foo</i>
<p aria-label="my label">foo</p>
<div id="label">my label</div>
<div aria-labelledby="label">foo</div>
<span aria-labelledby="label">foo</span>
<i aria-labelledby="label">foo</i>
<p aria-labelledby="label">foo</p> No browser / screen reader combination read the |
Closes issue: #1575