react-tooltip icon indicating copy to clipboard operation
react-tooltip copied to clipboard

Tooltip misalignment when scrolling

Open hemae opened this issue 1 year ago • 1 comments

Bug description When using tooltips inside scrollable containers (specifically the window), the tooltip appears correctly next to the target element in the initial scroll state (see Screenshot 1). However, after scrolling the parent element (window), the tooltip appears misaligned—either above or below the target element (see Screenshot 2).

Version of Package v5.28.0

To Reproduce

  • Add a tooltip to an element inside a scrollable window.
  • Observe correct tooltip positioning before any scrolling (Screenshot 1).
  • Scroll the page.
  • Observe the tooltip’s incorrect positioning after scrolling (Screenshot 2).

Expected behavior The tooltip should remain aligned with the target element regardless of the scroll position.

Screenshots Screen Shot 2024-09-20 at 3 22 57 PM Screen Shot 2024-09-20 at 3 23 03 PM

Desktop:

  • OS: macOS Monteray 12.6.1
  • Browser: Google Chrome
  • Version 128.0.6613.139 (Official Build) (x86_64)
  • Frameworks: React 17.0.2

hemae avatar Sep 20 '24 11:09 hemae

Have you tried moving the tooltip component inside the scrollable parent? That usually fixes the issue, but depending on your project's structure, it might not be viable for you to do.

Let me know, and I'll try to suggest some other approach.

gabrieljablonski avatar Sep 20 '24 17:09 gabrieljablonski

This issue is stale because it has not seen activity in 30 days. Remove the stale label or comment within 14 days, or it will be closed.

github-actions[bot] avatar Dec 20 '24 12:12 github-actions[bot]

Any updates here I am facing same issue with Android devices

AdamDia avatar Jan 07 '25 18:01 AdamDia

@AdamDia as suggested above, you should try placing the <Tooltip /> component anywhere inside of the scrollable parent.

If that does not help, we would need a reproducible example to be able to help further.

gabrieljablonski avatar Jan 07 '25 19:01 gabrieljablonski

This issue is stale because it has not seen activity in 30 days. Remove the stale label or comment within 14 days, or it will be closed.

github-actions[bot] avatar Apr 08 '25 12:04 github-actions[bot]