adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
12.75k stars 1.09k forks source link

Tooltip gets stuck to the screen while the user is scrolling over the screen. #6546

Closed GeetanshuGulati closed 4 weeks ago

GeetanshuGulati commented 3 months ago

Provide a general summary of the issue here

We are facing an issue with the tooltip wrapped over the action button. The tooltip gets stuck to the screen while the user is scrolling over the screen.

code sandbox https://codesandbox.io/p/sandbox/infallible-chatterjee-m6mx6j

https://github.com/adobe/react-spectrum/assets/34887112/01178f34-466b-47ae-a10b-1006652b5525

๐Ÿค” Expected Behavior?

tooltip should not stick to screen while scrolling

๐Ÿ˜ฏ Current Behavior

tooltip stick to screen while scrolling

๐Ÿ’ Possible Solution

No response

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

code sandbox https://codesandbox.io/p/sandbox/infallible-chatterjee-m6mx6j

Version

3.35.1

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

platform independent reproducable

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

snowystinger commented 3 months ago

Thanks for reporting, looks like we need to pass

onClose: () => state.close(true)

to useOverlayPosition in TooltipTrigger https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/tooltip/src/TooltipTrigger.tsx#L73

Would you like to contribute and write a test for it?

rtwayland commented 2 months ago

I'm seeing this for react-aria-components as well

pr7prashant commented 1 month ago

I've faced this as well before. @snowystinger can I pick this one. Seems to be open and idle for a while now. Thanks

PR: https://github.com/adobe/react-spectrum/pull/6984