Long-term solution for an accessible RelativeTime component #4645
Unanswered
lindseywild
asked this question in
General
Replies: 1 comment 1 reply
-
Hi! Thinking about this a little and I have some random thoughts for you:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR
We need to come up with a long-term solution for an accessible RelativeTime component that is not using the
title
attribute. This spawns from conversation on a PR that adds anoTitle
option to RelativeTime component.Background
Primer has received accessibility audit issues related to the RelativeTime component which mention the use of the
title
attribute (that displays the longer date/time) is inaccessible to keyboard, screen reader, and mobile users. This component utilizes therelative-time-element
web component under the hood.The ideal solution would be to remove the
title
attribute entirely, however, that may impact users since this component is used all over GitHub. So, we'd like to explore finding an alternative way to display the information that currently lives in thetitle
attribute.Documentation is being added with alternative solutions, however, we still don't have a great alternative for non-interactive static text implementations of
<RelativeTime>
.We've hosted an accessibility engineering office hour around potential uses of
aria
for these static implementations, but we still need to user test implementations and see if there is something we can come up with. The alternative is to run user testing with removing thetitle
attribute to see if that is a viable option since that is the easiest change to make.Some ideas floated in a Slack thread:
Future thinking
Since we already have a solution for interactive elements (associating them with an accessible tooltip), we can bake that into Primer once we also have a solution for non-interactive elements.
For removing the current, temporary implementation, we can:
noTitle
, but make it do nothing under-the-hoodno-title
/no_title/
noTitle` references, then fix type errors(courtesy of @smockle)
Beta Was this translation helpful? Give feedback.
All reactions