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

[Toasts] long text without white space overflows outside toast element #7566

Closed
eokoneyo opened this issue Mar 11, 2024 · 2 comments · Fixed by #7568
Closed

[Toasts] long text without white space overflows outside toast element #7566

eokoneyo opened this issue Mar 11, 2024 · 2 comments · Fixed by #7568
Assignees
Labels

Comments

@eokoneyo
Copy link
Contributor

Describe the bug
If it does happen that an EuiToast is to be rendered with a title text that's long and doesn't contain any white space the text doesn't wrap but rather overflows outside of the toast element.

Impact and severity
when this occurs, it's pretty visible and jarring. Also see elastic/kibana#178351

Environment and versions

  • EUI version: 93.2.0

To Reproduce
Steps to reproduce the behavior:

  1. Go to any setup that would render a toast
  2. Pass said toast a title that's pretty long, and doesn't contain white space
  3. On render the toast will have it's title overflow out of the toast item that received the title text.

Expected behavior
The title text should wrap within the context of the toast element and not overflow outside of the toast.

Screenshots

Actual

Screenshot 2024-03-11 at 14 24 04

Expected

Screenshot 2024-03-11 at 14 50 09
@eokoneyo eokoneyo added bug ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible labels Mar 11, 2024
@cee-chen cee-chen removed the ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible label Mar 11, 2024
@cee-chen
Copy link
Contributor

cee-chen commented Mar 11, 2024

I believe the original impetus for not baking this in was to force consumers to evaluate the copy/content they were passing into toast titles (i.e., it could be argued the onus is on the consumer to truncate the PDF name to a certain character limit, and not on EUI). However, our own docs example has an overflow issue so I'm not sure how true this still is 🥲

I chatted with @florent-leborgne about this and he agreed that we should go ahead and always wrap overflowing text. He'll also revisit our toast guidelines at some point with suggestions on best practices in using IDs in toast titles.

@eokoneyo
Copy link
Contributor Author

I do agree that ideally the onus should be on the consumer to account for the rendering of the text being passed in especially that it accepts a ReactNode, I'd raised this issue because for this case (and any case) where the full text would rather be displayed one can't correct for this externally given the current markup.

Thanks for the quick turn around, and I quite look forward to seeing the update guidelines for IDs in toast titles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants