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

Multiline support for tooltip #6865

Closed
Dudeplayz opened this issue Nov 25, 2024 · 2 comments · Fixed by vaadin/web-components#8255
Closed

Multiline support for tooltip #6865

Dudeplayz opened this issue Nov 25, 2024 · 2 comments · Fixed by vaadin/web-components#8255
Assignees
Labels

Comments

@Dudeplayz
Copy link

Describe your motivation

It would be nice to have multiline / line-break support in tooltips. I have used this addon https://vaadin.com/directory/component/tooltips4vaadin from the directory and I am replacing them now with the standard vaadin API. This addon rendered line-breaks correctly. So in order to replace it, I have to use Popover instead to add multiline html elements.

Describe the solution you'd like

Rendering of line-breaks.

Describe alternatives you've considered

Using Popover.

Additional context

No response

@Dudeplayz
Copy link
Author

Got it working by specifying it with CSS:

vaadin-tooltip-overlay::part(content) {
    white-space: pre-wrap;
}

Question is still, if this should be a default feature?

@yuriy-fix yuriy-fix added good first issue Good for newcomers refactor Internal improvement vaadin-popover workaround labels Nov 28, 2024
@web-padawan
Copy link
Member

web-padawan commented Nov 29, 2024

This was previously requested in #5120 and yes, setting white-space on the content is the proper way to handle it.
IMO we could have an example in the docs illustrating how to do that. Not sure if that deserves a theme variant.

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.

3 participants