question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tooltip crops if renders in `Overflow: hidden` element

See original GitHub issue

Hi. This is too big problem if you render tooltip inside an element which has prop - overflow: hidden. image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
nmartinezb3commented, Dec 23, 2021

This can be fixed this by placing an empty div in your body and using portals:

const tooltipContainer = document.getElementById("tooltip-container")
<div>
  <a data-tip data-for="my-tooltip">
    <Icon />
  </a>
  {ReactDOM.createPortal(
    <ReactTooltip
      id="my-tooltip"
      {...props}
    >
      Some tooltip content
    </ReactTooltip>,
    tooltipContainer
  )}
</div>
3reactions
Tarpsvocommented, Feb 27, 2018

That’s what overflow: hidden does. Either make the overflow visible or put the tooltip in a parent view. Or place it at the end of the body element using Portals.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tooltip crops if renders in Overflow: hidden element #358
Hi. This is too big problem if you render tooltip inside an element which has prop - overflow: hidden.
Read more >
Display tooltip when container overflow is hidden
There's a way to display an element in these conditions, by having it absolutely positioned (as a simple wrapper) and containing a relatively...
Read more >
overflow:hidden cropping tooltip. - CodePen
About CSS Base. It's a common practice to apply CSS to a page that styles elements such that they are consistent across all...
Read more >
Can CSS Prevent Tooltips Overflow? - CSS-Tricks
Sometimes UI elements, like tooltips, need to be edge-aware to prevent the content inside from triggering weird scrollbars or cutting off ...
Read more >
Learn React Portals by example - LogRocket Blog
The solution is to append tooltip or dropdown directly to the body of the document, set position: fixed style, and provide screenX and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found