Tooltip with hover trigger not working on page with scrollbar
See original GitHub issueDescribe the bug
When mouse enters trigger element and page has vertical scrollbar and his position is not at top of page then tooltip is flickering and does not remain visible. Problem is probably with function mouseOutsideRect
and comparing mouse and trigger position: (pageY || clientY) < Math.floor(top) || (pageY || clientY) > Math.ceil(bottom)
.
To Reproduce Steps to reproduce the behavior: https://codesandbox.io/s/white-leaf-094it?file=/src/index.js https://user-images.githubusercontent.com/18634735/108426708-613e2900-723c-11eb-924b-b7b9096d97dc.mov
Expected behavior Tooltip should remain visible after hover button.
Desktop (please complete the following information):
- OS: macOS
- Browser chrome
- Version 88
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:14 (12 by maintainers)
Top Results From Across the Web
Hover tooltip stops working after scrolling - Stack Overflow
The main problem is, your tooltip is insite an element with display:fixed style. When you change the tooltip's position, it counts the top...
Read more >Hovering over a tooltip trigger scrolls page to top #140 - GitHub
When I hover over the button that has the tooltip class on it for ... Even changing it from an anchor tag to...
Read more >Tooltip does not disappear when scrolling - GitLab.org
Hover over a link with a tooltip. Click the link. Use the browser back button. Observe that the tooltip is now a permanent...
Read more >JavaScript · Bootstrap
If a function is given, it will be called with its this reference set to the element that the tooltip is attached to....
Read more >Tooltipster - The jQuery Tooltip Plugin - GitHub Pages
The easiest way to set when a tooltip should open or close is to set the trigger option to one of the two...
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
@mohsinulhaq works well, thank you.
@czabaj thanks for filing it, I was thinking the same, but I thought first I would consult StackOverflow. But there was no reply, so I guess, no problem.
Btw, shouldn’t we add/subtract 1 only for Chrome?