feat(aria-label): new rule to flag incorrect use of aria-label, aria-labelledby, and aria-describeby - #2712
feat(aria-label): new rule to flag incorrect use of aria-label, aria-labelledby, and aria-describeby#2712straker wants to merge 5 commits into
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.
I'd like to see some test data on this. What is the problem we are solving with this rule?
WilcoFiers
left a comment
There was a problem hiding this comment.
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