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

Truncate default state is not accessible to keyboard users #1619

Open
khiga8 opened this issue Nov 18, 2022 · 7 comments
Open

Truncate default state is not accessible to keyboard users #1619

khiga8 opened this issue Nov 18, 2022 · 7 comments
Labels

Comments

@khiga8
Copy link
Contributor

khiga8 commented Nov 18, 2022

Currently the Truncate component defaults to a span.

span elements cannot be keyboard-focused. Keyboard users will not be able to reach this element to expand it.

@lesliecdubs
Copy link
Member

Thanks for filing!

Looking at the stories for Truncate it seems like switching from a span to an interactive element wouldn't necessarily make sense semantically. @khiga8 is adding a tabindex attribute bad practice in this case, or is there a better way to resolve this?

@khiga8
Copy link
Contributor Author

khiga8 commented Nov 29, 2022

Hi @lesliecdubs,

With tooltip, I've asked a similar question around whether we can set tabindex to make a span element focusable to allow setting a tooltip. The conclusion was no, settingtabindex to make something focusable would not be appropriate ecause the element itself is still a generic element -- it does not have a role that would imply that behavior is attached.

I think the same applies here for Truncate. Maybe beyond this Truncate example not being keyboard accessible, we need to evaluate whether there are valid uses for this component. There's a PR in progress (primer/design#325) which discusses options for truncations!

cc: @alexislucio who was involved in those convos and might have thoughts.

@lesliecdubs
Copy link
Member

lesliecdubs commented Dec 1, 2022

Thanks for teaching me about the best practice on this @khiga8!

@alexislucio interested to hear your thoughts on this when you have a minute. It looks like there are at least 26 unique files in github/github that utilize Truncate, so if the outcome is that we may want to deprecate this component there will be some work to do to ensure we don't break any UI with is removal.

If no changes are needed there, I'd be interested to know what you'd recommend changing the span element to in order to make the Truncate example in Lookbook compliant with receiving keyboard focus.

@github-actions
Copy link
Contributor

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.

@github-actions github-actions bot added the Stale Automatically marked as stale. label May 30, 2023
@lesliecdubs lesliecdubs removed the Stale Automatically marked as stale. label May 31, 2023
Copy link
Contributor

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.

@github-actions github-actions bot added the Stale Automatically marked as stale. label Nov 27, 2023
@khiga8
Copy link
Contributor Author

khiga8 commented Nov 27, 2023

not stale.

@github-actions github-actions bot removed the Stale Automatically marked as stale. label Nov 27, 2023
Copy link
Contributor

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.

@github-actions github-actions bot added the Stale Automatically marked as stale. label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants