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

Discuss and document guidelines for using EuiTooltip vs the title property #3588

Closed
cchaos opened this issue Jun 10, 2020 · 5 comments
Closed

Comments

@cchaos
Copy link
Contributor

cchaos commented Jun 10, 2020

Could you clarify if this is a general recommendation not to use EuiTooltip then anymore? Because this performance issue is really severe for us, and if the solution from design is to use title instead, we'd start removing EuiTooltip in large across our apps. So would be good to have some clarity (and maybe adding it to the EUI documentation) if we no longer recommend using this component, or if the issue can somehow be prioritized on your side?

Originally posted by @timroes in #3568 (comment)


Starting a conversation ...

on how we want to handle our guidance to consumers over when to use EuiTooltip or simply use title. I know there's also some a11y concerns to consider.

@myasonik
Copy link
Contributor

Generally, title is considered completely inaccessible so I'd basically never recommend using it.

With alternatives, title could be part of an accessible pattern but, at that point where you're already building alternatives, why not build a single accessible alternative?

It might be easier to make a more performant tooltip if it was text only (whereas Tooltip currently allows any JSX) which matches the capabilities of title and would also make accessibility easier so it seems like a win all around (though I haven't actually researched the perf aspects of this and am guessing).

@snide
Copy link
Contributor

snide commented Jun 10, 2020

To somewhat respond to @myasonik's observation.

There is one good place where title works and where it's fine as far as accessibility, and that's in showing a CSS (key part!) truncated word in string form.

Dave Sni... becoming Dave Snider in a title is perfectly fine because it works accessibily in a screenreader regardless.

Generally this is the best (and probably only) place to use it. If we have issues with how tooltips look, perform, or render vs title, we should likely augment tooltip to better address those concerns since as @myasonik mentions, we have better control over it's abilities (especially when it contains content that is not in the original string)

@myasonik
Copy link
Contributor

title still doesn't help keyboard or touch (i.e., mobile/tablet) only users so you're right that screen readers will pick up on the full string but it's still worse than us building a solution

@cchaos
Copy link
Contributor Author

cchaos commented Jun 10, 2020

I've had on my personal Todo list of experimentations is a truncation component (EuiTruncate) that automatically adds an EuiTooltip. This is probably the best solution to provide consumers with easy to use truncation best practices since a lot of them don't even use title or any other method of providing the full string. Though it may all hinge on being able to me EuiTooltip more performant.

@cchaos
Copy link
Contributor Author

cchaos commented Sep 18, 2020

Closing in favor of a Meta discussion around EuiTooltip flexibility which I've included a link to this discussion but needs to be a part of a greater effort.

@cchaos cchaos closed this as completed Sep 18, 2020
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