Skip to content

Tooltip Text Wrapping #3653

Answered by SiTaggart
brianhumphreys asked this question in Q&A
Dec 5, 2023 · 2 comments · 6 replies
Discussion options

You must be logged in to vote

Hi

In this case, the suggestion made by PasteBot is probably the right path. It just misses one small detail from the Truncate component, which is the title attribute.

Tooltips can only be place on actionable, focusable elements in any UI. That is WCAG requirement for accessibility. They can't be placed on text, so they can't be used for showing the long strings, unless that long string is in a link, or a button. I'm not sure if that is the case here.

By using the Truncate component with the title attribute, you do get the full string on hover via the browser native API. It's not perfect, but it's not inaccessible.

Hopefully that solves for the case, if you're not using focusable elements.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@SiTaggart
Comment options

Answer selected by SiTaggart
@brianhumphreys
Comment options

@SiTaggart
Comment options

@brianhumphreys
Comment options

@brianhumphreys
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants