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.

[a11y] play button not recognized as button

See original GitHub issue

Because the play/pause button is a <div> and not a <button>, screen-readers don’t recognize it as interactive. There are two options that I see: Either change the div tag to a button tag, or use the role attribute (as in role="button"). Once we’re dealing with the play button, I noticed that there is no text associated with the button. Maybe we should put an aria-label, and/or an aria-checked to indicate the state https://github.com/freeCodeCamp/coderadio-client/blob/c721fbfaeedc0b1e529c0552426a267d21a0e596/src/components/Footer.js#L89-L9

Connected to #20

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
huyenltnguyencommented, Apr 3, 2020

@b3u Thanks for letting me know. I will gladly take this from you then.

Looking forward to your future contributions. But in the meantime, happy coding (and stay safe) 😃

1reaction
huyenltnguyencommented, Mar 30, 2020

@b3u Thanks for reporting the issue 👍 Feel free to tackle it if you are interested.

For the solution, I don’t think there is a reason for the button to be a <div>, so I think changing it to <button> should be fine. My approach would be similar to yours, but I would use aria-pressed in place of aria-checked since it seems to be associated with button more (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role):

<button type="button" aria-label="play" aria-pressed={isPlaying}>
  { isPlaying ? <Pause /> : <Play /> }
</button>
Read more comments on GitHub >

github_iconTop Results From Across the Web

ARIA: button role - Accessibility - MDN Web Docs
Toggle buttons · If aria-pressed is not used, or is set to the "undefined" state, the button is not a toggle button. ·...
Read more >
Button is not accessible and not focused on tab key
My problem here is 'Cancel' button is accessible on tab key, but not other two - Clear all and Apply. html · css...
Read more >
Building Accessible Buttons with ARIA: A11y Support Series
Continuing on with our series, we're going to build another accessible ARIA widget: a simple role=”button” UI control.
Read more >
Play/Pause and stop media keys not working
Play/Pause and stop media keys not working. Hi everyone,. So I've got a weird problem, and I haven't found anyone else with the...
Read more >
`<button>` with `title` is not considered to have an accessible ...
Describe the bug Accessibility Insights reports a button doesn't have an accessible name when the accessible name is set with title.
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