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

Always set a title attribute when truncating text via CSS #1923

Closed
cchaos opened this issue May 7, 2019 · 7 comments
Closed

Always set a title attribute when truncating text via CSS #1923

cchaos opened this issue May 7, 2019 · 7 comments
Labels

Comments

@cchaos
Copy link
Contributor

cchaos commented May 7, 2019

We need to establish a pattern where we add or require the html title attribute on elements that can be truncated with an ellipse. Most consumers don't think of this as necessary and tend to opt for the more intrusive tooltip to show the full text of the truncated element. All that's really necessary is the title attribute so that on long hovers, users can get the full text via the browser's internal tooltip mechanism.

Example: EuiBreadcrumbs

Screen Shot 2019-05-07 at 12 10 32 PM

It would also solve issues like #1706

Question

The one concern can be where the child element can be something other than a string (eg node). Is there a way we can pull just the inner text or should we just have the component require a title prop?

@chandlerprall
Copy link
Contributor

Is there a way we can pull just the inner text or should we just have the component require a title prop?

There isn't a clean way to extract a component's inner text, requiring a title prop will be much better.

@cchaos
Copy link
Contributor Author

cchaos commented May 7, 2019

Can we only require the title if the contents is not a string?

@chandlerprall
Copy link
Contributor

Yep! The messaging on that isn't controllable in TypeScript files, but we can definitely force an error in that state.

@snide
Copy link
Contributor

snide commented Sep 12, 2019

Inner text sort of fixed this https://elastic.github.io/eui/#/utilities/inner-text

Do we still think this issue is valid? It seems like the only thing left is just carrying through?

@cchaos
Copy link
Contributor Author

cchaos commented Sep 12, 2019

I think we should audit where we auto-apply truncation and see which components would be enhanced by adding the inner-text component.

@cchaos
Copy link
Contributor Author

cchaos commented Sep 18, 2020

Need to assess the a11y implications of this as well. See #4040 as related

@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
Projects
None yet
Development

No branches or pull requests

3 participants