-
Notifications
You must be signed in to change notification settings - Fork 247
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
Button element does not accept aria-label as a valid name for accessibility #160
Comments
Hi Matt, Thanks for your suggestion. I'll probably have to look into this in conjunction with #156 #157 #158 #159, and I've included sort-of a note-to-self to review the ARIA docs again at #162. From my reading of things, especially HTML-AAPI, I agree with you - the above WG note states the order should be based on "aria-labelledby", followed by "aria-label", followed by the relevant HTML attributes. This is also in line with the note in WCAG2-TECHS#ARIA6 which warns that "aria-label" will override the HTML attributes. |
Hello, I still have the problem running pa11y-ci@1.1.1, which runs pa11y@4.7.0, which bundles HTML_CodeSniffer@2.0.7.
It seems like HTML_CodeSniffer@2.0.7 does not include the fix. Correct? |
@hugogiraudel That is correct, the change is on the master branch which hasn't been tagged with a release yet. You could build from master if you were keen on getting the fix asap. |
Well, this bug affects every project that depends on this library, which is a lot. So a fix should be published from your side as soon as possible. |
Thanks for the quick reply! However —as @XhmikosR said— given it’s clearly a (small) bug in HTML_CodeSniffer, and given you also found, reviewed and merged a clean fix for it, isn’t there a way we could publish it as 2.0.8? |
@XhmikosR @hugogiraudel I've released the fix in 2.1.0 |
Thanks! |
Very cool, thank you! |
Same goes for |
@hugogiraudel Looking at the code I think you are correct, there should be some label detection here. Re-opening and will look at adding it. |
@ironikart Thanks! :) |
It looks correct to me but the code that was changed most recently only affects buttons and hyperlinks. I will re-open this and investigate for other element types. |
Wondering if the change had been implemented yet. I'm getting the same error. I have a |
@chavab1 This issue snuck under the radar for a bit, apologies. I've pushed up a fix for this now but won't be available in the bookmarklet until our next release. |
OK, sounds good. I'll be on the lookout for the next release. |
Hi, When are you likely to push a new release? |
I'm getting this: This button element does not have a name available to an accessibility API. Valid names are: title undefined, element content, aria-label undefined, aria-labelledby undefined. <button class="mini-cart_button" name="cart" dropdown-toggle"="" id="mini-cart" data-toggle="dropdown" data-count="0" aria-expanded="false" value="cart"> <span class="p... Does this mean my code is wrong or is it an error of the code sniffer widget? |
The sniffer was unable to find some text to describe the button to a screen reader. The suggestions are to add attributes like title, aria-label or aria-labelledby (if there is another element that has descriptive text for this button), or to have content in the button itself. If you think there is something wrong with the detection and it has descriptive text just paste the the full html snippet of this button and I can confirm for you. |
…e considered as having valid content.
…a labels to pass as valid names for an accessibility API. This will trigger on any element using that role. This resolves squizlabs#160.
This markup
Throws this error
Looking at the rules for H91 button I see very clearly
For which my code has neither.
However,
aria-label
is a valid name available to an accessibility API. In fact, by most screen readers it is preferred: http://www.deque.com/blog/text-links-practices-screen-readers/Has this been given consideration?
The text was updated successfully, but these errors were encountered: