question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accessibility: 'Buttons do not have an accessible name'

See original GitHub issue

Lighthouse accessibility audit message ‘Buttons do not have an accessible name’. Here are the two element listed:

<button type="button" class="control-arrow control-prev"></button>
<button type="button" class="control-arrow control-next"></button>

Would this pass by just adding a role or aria-label to these buttons? If so I would like to make a PR for this. I’ve never contributed to an open source project before and this seems like something easy for a newbie like myself.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
laneysmithcommented, Oct 3, 2018

@wildpow Snapshot tests are just “snapshots” of what the component tree should look like to pass a particular test. If you scroll up, you’ll see the diffs for all 10 failing tests, and they pretty much all look similar to this:

         <button
    +      aria-label="mobile navigation"
           className="control-arrow control-prev control-disabled"
           onClick={[Function]}
    +      role="presentation"
           type="button"
         />

All 10 are failing because previous snapshots didn’t have those role & aria-label attributes you added. You’ll need to update all those tests using npm test -- -u, then commit those updated snapshots along with your code changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Buttons must have discernible text | Axe Rules | Deque Systems
Screen reader users are not able to discern the purpose of elements with role="link" , role="button" , or role="menuitem" that do not have...
Read more >
Lighthouse error: "Buttons do not have an accessible name"
It suggests that the button should have inner text content or an aria-label or aria-labelledBy. <button class="search-button" type="submit"> ...
Read more >
Button has non-empty accessible name | ACT Rule | WAI - W3C
Description. This rule checks that each button element has a non-empty accessible name. Applicability. This rule applies to elements that are included in ......
Read more >
Technique: Accessible names for buttons
Accessible names are the labels given to HTML elements that can be announced in assistive technologies such as screen readers. They may or...
Read more >
button-name - Accessibility Insights
Assistive technologies can then refer to the object by name, not just by type. When a button doesn't have an accessible name, people...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found