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

Consider allowing aria-label on role="time" #2320

Closed
zcorpan opened this issue Aug 23, 2024 · 3 comments
Closed

Consider allowing aria-label on role="time" #2320

zcorpan opened this issue Aug 23, 2024 · 3 comments

Comments

@zcorpan
Copy link
Member

zcorpan commented Aug 23, 2024

The text content of an element with role="time" (when not the time element with a datetime attribute) is a machine-readable time, which is often not what you want to present to humans. For example, in https://shkspr.mobi/blog/2020/12/making-time-more-accessible/ there's a desire to have "1 hour ago" as the text exposed to accessibility APIs (and "1h" for visual rendering). Prohibiting name for role=time makes this unnecessarily difficult.

Originally posted by @zcorpan in #2075 (comment)

@zcorpan
Copy link
Member Author

zcorpan commented Aug 23, 2024

@scottaohara commented

Naming time may not be the best way forward here, so maybe something else closer to what abbr and the title attribute allow for should also be considered.

@scottaohara
Copy link
Member

thank you @zcorpan

some additional context for my comment is that some people may want the "1h" text to be announced to them as "1 hour ago", while some others are perfectly fine with the "1h" as visually rendered.

the way the abbr element and the title attribute work with JAWS, for example, is that title doesn't just overwrite the text of the abbr as its name. But JAWS provides a setting so that someone can make the choice to hear the abbr as either what's presented visually, or replaced with the content of the title attribute. Being a user choice, this can then also mitigate any awkwardness for someone who might need to copy/paste a selection of text that includes an abbr (or in this case, a time element) - and upon pasting they find that the text that they heard is not matching what they pasted.

in summary, i like this idea of this proposal - i just am not sure aria-label is the way to go here. We have also talked about how there's a need for an 'alternate label' or 'terse label' in relation to other scenarios, like mitigating overly long captions, legends and column/row headers. This might be worth considering in those buckets as well, since there's no good way to even replicate what abbr title=... allows with ARIA right now.

@mcking65
Copy link
Contributor

If an author chooses to expose machine-friendly language to sighted users, they should do the same for screen reader users.

Prohibiting naming of the element ensures that the actual content of the element is accessible to everyone. It is a design decision to show "1H ago" instead of "1 Hour Ago" to users.

Per discussion in August 29, 2024 ARIA working group telecon, closing this as won't fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants