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] Closing tooltip when scroll starts vs when scroll stops #1447

Open
sunwrobert opened this issue Feb 15, 2025 · 3 comments
Open

[Tooltip] Closing tooltip when scroll starts vs when scroll stops #1447

sunwrobert opened this issue Feb 15, 2025 · 3 comments
Assignees
Labels
component: tooltip This is the name of the generic UI component, not the React module!

Comments

@sunwrobert
Copy link

Bug report

Current behavior

Hi, great library! We're using this at OpenSea and using the attachToCursor option to power one of our Collection link hoverables. However, we are noticing issues where if people are scrolling while it's attaching, it can get to a state where it no longer disappears even if the mouse is no longer on the anchor.

https://www.loom.com/share/9608676b8c904397af37d46b059ea9b9

Here's a video showcasing this. I don't have a reproducible example in a sandbox at the moment, but wondering if as a stop gap we could at least expand the Tooltip behavior to close if scrolled? Not sure of the best solution here. Thanks!

Expected behavior

Provide a clear and concise description of the expected behavior.

Reproducible example

Link to a CodeSandbox, StackBlitz, or other IDE.

Base UI version

For example v1.0.2

Which browser are you using?

Chrome/Safari/Firefox/Safari iOS etc.

Which OS are you using?

Mac OS/Windows/Other etc.

Which assistive tech are you using (if applicable)?

Voiceover/JAWS etc.

Additional context

Provide any additional context that might help us identify the problem and find a solution.

@sunwrobert sunwrobert added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 15, 2025
@atomiks atomiks added component: tooltip This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 16, 2025
@atomiks
Copy link
Contributor

atomiks commented Feb 16, 2025

Hi @sunwrobert, attachToCursor isn't a valid option for Base UI's Tooltip (the option is trackCursorAxis) - are you in the right repo? If so, a full reproduction would greatly help

@mj12albert mj12albert added the status: waiting for author Issue with insufficient information label Feb 17, 2025
@sunwrobert
Copy link
Author

Sorry, yeah I meant trackCursorAxis

@github-actions github-actions bot removed the status: waiting for author Issue with insufficient information label Feb 19, 2025
@sunwrobert sunwrobert changed the title [Tooltip] attachToCursor tooltip can sometimes keep following cursor even if not hovering on anchor [Tooltip] trackCursorAxis tooltip can sometimes keep following cursor even if not hovering on anchor Feb 19, 2025
@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 19, 2025
@mj12albert
Copy link
Member

mj12albert commented Feb 19, 2025

we could at least expand the Tooltip behavior to close if scrolled?

Related: mui/material-ui#38379

We discussed closing the tooltip on scroll start vs stop before but didn't reach a decision yet: https://mui-org.slack.com/archives/C02P87NQLJC/p1732704384238479 CC @colmtuite

Currently it closes when scroll stops which is intentional, the docs demo demonstrates this: https://master--base-ui.netlify.app/react/components/tooltip

@mj12albert mj12albert removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 19, 2025
@mj12albert mj12albert added new feature New feature or request and removed new feature New feature or request labels Feb 19, 2025
@mj12albert mj12albert changed the title [Tooltip] trackCursorAxis tooltip can sometimes keep following cursor even if not hovering on anchor [Tooltip] Closing tooltip when scroll starts vs when scroll stops Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tooltip This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

4 participants