[a11y] play button not recognized as button
See original GitHub issueBecause 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:
- Created 3 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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) 😃
@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 usearia-pressed
in place ofaria-checked
since it seems to be associated with button more (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role):