-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Only add title attribute to item if item text has been truncated #8073
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context menu, and other components that have items that may get truncated if the string is too long, have been using CSS to truncate the string and add an ellipsis, which is fine, but then a title is added to all items just to make sure that any truncated strings can be hovered to see the whole string. There are a couple of problems with this:
Please only add a tooltip if the text has actually been truncated.
#7768 may help with the logic for this issue.
Would be good to look at all Carbon components where long items are truncated, to see whether the code can be abstracted out and used for all such items.
In addition, consider whether you really want to use title, or whether Carbon's "Icon tooltip" (name should probably be more generic) might make for a more consistent "tooltip experience" across pages using Carbon. This would fix the keyboard-only problem (3). In addition, if you don't hook up aria-describedby, then you will fix the double-speak problem too (1) (because the item will have a name - which the screen reader can already see - but it won't have a description that just duplicates the name).
The text was updated successfully, but these errors were encountered: