Current time aria-label accessibility issue #2588
live-4-code
started this conversation in
General
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I love plyr, especially because of it's accessibility support. I did notice an accessibility issue in plyr that is easy to resolve.
The aria-label attribute with value "Current Time" is used on the current time <div> element. The aria-label attribute is only appropriate on elements that can have an accessible name. The value may not be announced by assistive technologies when it's used on an element that doesn't typically have an accessible name or label. The aria-label="..." attribute can be used on interactive elements (such as <button>), on landmark regions (such as <nav>), on elements with a widget role (such as role="dialog"), and also on <iframe> and <img> elements. It should not be used on any other kind of element.
Recommendation: Remove the aria-label="Current time" attribute from the current time <div> and include the "Current Time" text in an sr-only <span>, inside the <div>, prior to the time so that screen readers read the text, "Current Time <time>."
Resource: https://www.tpgi.com/short-note-on-aria-label-aria-labelledby-and-aria-describedby/)
Please let me know if you have any questions!
Beta Was this translation helpful? Give feedback.
All reactions