React bootstrap tooltip overlay is not positioned correctly
See original GitHub issueDescription
I have been working with overlays. I had created a simple tooltip using react bootstrap’s Tooltip
class. I have created it in such a way that, whenever the mouse hovers over the button, It shows the tooltip and it’s content. But when I take a look at the result, The tooltip is not positioned correctly.
To Reproduce
Steps to reproduce the behavior:
- Created a tooltip using the
Tooltip
class - Went to the browser to see the result
- Discovered that the tooltip is positioned incorrectly
Reproducible Example
Sandbox to show the incorrect positioning.
Expected behavior
Expected the tooltip to be positioned next to the button. On the left side of the button
Screenshots
Environment (please complete the following information)
- Operating System: Windows
- Browser, Version: Chrome 81
- React-Bootstrap Version: 1.0.1
Additional context
The same issue occurs with other overlays for me such as popovers.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
React-bootstrap OverlayTrigger is not positioned correctly ...
I have main container with list of buttons and every button is wrapped with OverlayTrigger (Tooltip in overlay). As there are many list...
Read more >How to Position a React-Bootstrap Popover
In this guide, you'll learn how to use a popover component from the React-Bootstrap library and learn to position it on the page....
Read more >Why Positioning a Tooltip Accurately with React So ...
We position get the position & size by getBoundingClientRect API of above components, and change the position of overlay to close to trigger ......
Read more >Overlays | React-Bootstrap
The <Tooltip> and <Popover> components do not position themselves. Instead the <Overlay> (or <OverlayTrigger> ) components, inject ref and style props.
Read more >Popovers
The Popover component, like the Tooltip can be used with an OverlayTrigger Component, and positioned around it. Holy guacamole! Holy guacamole!
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 Free
Top 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
@Meryldominguez, I just ran into the same problem. In my case, my overlay, was pointing to a
React.FC
, and I had to change it to beReact.forwardRef
in order for the overlay to position correctly. But it worked after I made that change.Hi! Im actually having this issue, despite spreading the injected props. I am working on a Navbar that re-renders based on the ‘status’ of the ‘event’ namely ‘published’,‘pending’, or ‘draft’
<kbd>
</kbd>
It seems that if one of the tooltips is triggered when the navbar buttons get re-rendered, I get the placement problem, despite having injected the props.
<kbd>
</kbd>
^see above with tooltip in far left top corner
Any help on this @jquense?