`<button>` with `title` is not considered to have an accessible name
See original GitHub issueDescribe the bug
Accessibility Insights reports a button doesn’t have an accessible name when the accessible name is set with title
.
To Reproduce
- Create a page that has
<button class='some css with background image' title="an accessible name"></button>
on it. - Run the automated tests from the extension
- See that the extension reports a failure for WCAG 4.1.2, button does not have accessible text.
Expected behavior
<button>
with title
set should not be flagged as not having accessible text.
Extension (please complete the following information)
- OS: Windows
- Version: Accessibility Insights for Web 2.6.0 (axe-core 3.2.2)
- Browser Version: Chrome version 75.0.3770.100
- Target Page: internal
Are you willing to submit a PR?
Maybe? I’ve never contributed before.
Did you search for similar existing issues?
yes
Additional context
Technique H91: Using HTML form controls
According to the W3 spec for the Accessibility API, title
is in the list of things to consider for the accessible name of a <button>
Failure details from the extension:
Title: WCAG 4.1.2: Buttons must have discernible text (iframe;.pswp__button–arrow–left) Tags: Accessibility, WCAG 4.1.2, button-name
Issue: Buttons must have discernible text (button-name: https://dequeuniversity.com/rules/axe/3.2/button-name?application=msftAI)
Snippet: <button class="pswp__button pswp__button--arrow--left" title="Previous"> </button>
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
hi @clottman , thanks for reporting the issue. This is a false positive caused because of the “space” inside the
<button>
element.We are going to update axe-core to version 3.3.0 pretty soon. It contains PR https://github.com/dequelabs/axe-core/pull/1615 which fixes this issue
Marking this as resolved, please let us know if you encounter this issue again and we can reactivate this bug 😃