Skip to content
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

Lighthouse warning: Buttons do not have an accessible name #866

Closed
abdonrd opened this issue Jul 5, 2018 · 14 comments
Closed

Lighthouse warning: Buttons do not have an accessible name #866

abdonrd opened this issue Jul 5, 2018 · 14 comments
Labels
a11y Accessibility issue next Future ideas refactor Internal improvement requires new major This would be a breaking change Severity: Major vaadin-button

Comments

@abdonrd
Copy link
Contributor

abdonrd commented Jul 5, 2018

Lighthouse report from vaadin-button v2.0.1 demos:
https://builder-dot-lighthouse-ci.appspot.com/report.1530781843420.html

screen shot 2018-07-05 at 11 09 47

@web-padawan
Copy link
Member

Apparently, latest Lighthouse beta changed the a11y audit and there are new warnings. We need to check other components too.

@abdonrd
Copy link
Contributor Author

abdonrd commented Jul 5, 2018

@web-padawan thanks! Anyway, I have used the stable Lighthouse v3.0.0.

@web-padawan
Copy link
Member

Confirmed this warning with the Lighthouse 3.0.1 (available as a Chrome extension)
Note that Chrome builtin audit in DevTools still uses 2.9.1

@abdonrd
Copy link
Contributor Author

abdonrd commented Jul 31, 2018

Any news here? Thanks in advance!

@aarondrabeck
Copy link

+1

@aarondrabeck
Copy link

+1

@Haprog
Copy link
Contributor

Haprog commented Apr 10, 2019

Reopening this, as the previous fix had to be reverted (c451eaa) to fix a performance regression (#128)

@Haprog Haprog reopened this Apr 10, 2019
@chrisgo67
Copy link

Any news on this?
What is the status with Vaadin 14 components?

@web-padawan
Copy link
Member

I tested this with axe and it reports following accessibility violations:

---
Rule: aria-allowed-role
Impact: minor
ARIA role must be appropriate for the element (https://dequeuniversity.com/rules/axe/3.4/aria-allowed-role?application=axeAPI)

Issue target: vaadin-drawer-toggle,button
Context: <button type="button" role="presentation" tabindex="0"></button>
Fix any of the following:
  ARIA role presentation  is not allowed for given element

---
Rule: button-name
Impact: critical
Buttons must have discernible text (https://dequeuniversity.com/rules/axe/3.4/button-name?application=axeAPI)

Issue target: vaadin-drawer-toggle
Context: <vaadin-drawer-toggle tabindex="0" role="button"></vaadin-drawer-toggle>
Fix any of the following:
  Element does not have inner text that is visible to screen readers
  aria-label attribute does not exist or is empty
  aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
  Element's default semantics were not overridden with role="presentation"
  Element's default semantics were not overridden with role="none"
  Element has no title attribute or the title attribute is empty
---

When trying to use aria-hidden there is another error:

Accessibility Violations
---
Rule: aria-hidden-focus
Impact: serious
ARIA hidden element must not contain focusable elements (https://dequeuniversity.com/rules/axe/3.4/aria-hidden-focus?application=axeAPI)

Issue target: vaadin-drawer-toggle,button
Context: <button type="button" aria-hidden="true" tabindex="0"></button>
Fix all of the following:
  Focusable content should be disabled or be removed from the DOM

Regardless of that, VoiceOver on Safari properly handles role="button" on the host element (which is vaadin-drawer-toggle or vaadin-button - both use the same structure).

@web-padawan
Copy link
Member

web-padawan commented Jan 29, 2020

Note: the original decision to use this roles structure was done 2 years ago:

See the comments

I have tried to revert role="presentation" and tested it with VoiceOver on Mac OS Mojave:

  • Chrome: "button, group. you are currently on a button"
  • Safari: "you are currently on a button inside web content"

When adding aria-label="toggle" to the drawer toggle, Chrome works correctly.

@web-padawan
Copy link
Member

See https://www.w3.org/TR/using-aria/#fifthrule for the actual issue.

@anezthes
Copy link
Contributor

anezthes commented Apr 3, 2020

@juuso-vaadin
Copy link
Contributor

Did some testing and buttons are announced as they should when using

  • Safari + VoiceOver

Button label is not announced at all in

  • Chrome + VoiceOver
  • Chrome + NVDA
  • Firefox + NVDA
  • Chrome + Windows Narrator

I don't have access to JAWS at the moment.

Current workaround is to manually set the aria-label.
In Flow this is done with
button.getElement().setAttribute("aria-label", "Click me");

@vaadin-bot vaadin-bot transferred this issue from vaadin/vaadin-button May 19, 2021
@vaadin-bot vaadin-bot added a11y Accessibility issue next Future ideas refactor Internal improvement requires new major This would be a breaking change Severity: Major vaadin-button labels May 19, 2021
@web-padawan
Copy link
Member

Closing as fixed by #2394. I have created a separate ticket for testing - see #2571.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility issue next Future ideas refactor Internal improvement requires new major This would be a breaking change Severity: Major vaadin-button
Projects
None yet
Development

No branches or pull requests

10 participants