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

Tooltip position when scrolling a container with overflow: auto/scroll #41

Closed
joaovpmamede opened this issue Jan 27, 2016 · 4 comments
Closed

Comments

@joaovpmamede
Copy link

Not sure if it's because the Tooltip Component is being rendered in body instead of inside another DOM node but when scrolling a div that has overflow: auto/scroll, the tooltip won't "stick" to its container.

In the simple example you can scroll and the tooltip is stuck to the container.

@yiminghe
Copy link
Member

yiminghe commented Mar 9, 2016

use getTooltipContainer to render inside specified container

@joaovpmamede
Copy link
Author

Ok, thanks.
Will try that as soon as possible.

@benboomz
Copy link

I have tried this but it does not work as the tooltip stays in place while scrolling. Could you provide an example?

@mikemunsie
Copy link
Contributor

mikemunsie commented May 1, 2017

I just ran into this issue and I used getTooltipContainer to return the container I wanted the tooltip to live in.

<Tooltip
  ...
  getTooltipContainer={() => document.querySelector(".myContainerIWantThisIn")}
>
...
</Tooltip>

The documentation is a bit unclear and doesn't specify that it will actually move the tooltip into the specified container. Might just add in a PR to help out.

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

No branches or pull requests

4 participants