[next] Tooltips breaks line on spaces on a container with position: 'absolute'
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
The tooltip with a title of “Test Title” to be shown without line breaks:
Current Behavior
The tooltip adds a line break for every space in the title: At first I thought it was a length issue, but it doesn’t break when there’s no spaces:
Steps to Reproduce (for bugs)
https://codesandbox.io/s/2wnv5jw2xj
- Container should have position: ‘absolute’
- Add an
IconButton
surrounded by aTooltip
- Set
Tooltip
’s title toTest Title
Context
I’m making a floating menu with absolute positioning, that moves around the screen to line up with an active component.
Your Environment
Tech | Version |
---|---|
Material-UI | ^1.0.0-beta.22 |
React | ^15.5.4 |
browser | Chromium Version 63.0.3239.84 (Official Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit) |
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
[next] Tooltips breaks line on spaces on a container ... - GitHub
I'm making a floating menu with absolute positioning, that moves around the screen to line up with an active component. Your Environment. Tech ......
Read more >CSS Tooltips line break - Stack Overflow
I fixed the issue by taking out the tooltip from the text content element, and wrapped the tooltip and text content width another...
Read more >Tooltips · Bootstrap v5.0
When triggered from hyperlinks that span multiple lines, tooltips will be centered. Use white-space: nowrap; on your <a> s to avoid this behavior....
Read more >How to Show, Position, and Style a Tooltip in HTML and CSS?
For the purpose of positioning the tooltip we are using the absolute value of the position property so that it can be placed...
Read more >Building a simple tooltip component that never goes off screen
The idea is to set the container with position: relative while the dropdown has a position: absolute and we can use a combination...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the workaround! I’ve tried messing with the positioning and widths, but it didn’t occur to me to override the internal classes.
@desktp I think issue boils down to the container div that Popper uses to show the Tooltip. Because that container has a certain width the text inside will get squished and you end up with what appears as line breaks. Simple way around this is to just set the tooltip to be 100% width of that container
I forked your codesandbox was able to get it to work by utilizing the classes prop on Tooltip. https://codesandbox.io/s/8yj6ryzjx2