-
Notifications
You must be signed in to change notification settings - Fork 791
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: Break up duplicate-id rule for ARIA+labels and for active elements #1097
Conversation
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.
Some small tweaks to the messages and (optionally) a few more tests and this is good to go
"impact": "critical", | ||
"messages": { | ||
"pass": "Document has no elements referenced with ARIA or labels that share the same id attribute", | ||
"fail": "Document has multiple elements referenced with ARIA or with the same id attribute: {{=it.data}}" |
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.
Change to Document has multiple elements referenced with ARIA with the same id attribute: {{=it.data}}
lib/checks/parsing/duplicate-id.json
Outdated
@@ -3,7 +3,7 @@ | |||
"evaluate": "duplicate-id.js", | |||
"after": "duplicate-id-after.js", | |||
"metadata": { | |||
"impact": "moderate", | |||
"impact": "minor", | |||
"messages": { | |||
"pass": "Document has no elements that share the same id attribute", | |||
"fail": "Document has multiple elements with the same id attribute: {{=it.data}}" |
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.
Change this to Document has multiple static elements with the same id attribute
?
</div> | ||
|
||
<button id="fail1" class="fail1"></button> | ||
<button id="fail1"></button> |
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.
Should we have more examples of failures? For example a <div tabindex="-1" id="fail2">blah</div><input id="fail2" />
etc.?
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.
Lgtm.
It took us a while to find it, but thanks for doing this. We really like this approach and agree it's got much higher signal:noise. :) |
Break the duplicate-id rule up into three rules:
Closes #163
Reviewer checks
Required fields, to be filled out by PR reviewer(s)