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 remains open if roots are too close #671

Closed
nooblyf opened this issue Sep 23, 2024 · 6 comments
Closed

Tooltip remains open if roots are too close #671

nooblyf opened this issue Sep 23, 2024 · 6 comments

Comments

@nooblyf
Copy link

nooblyf commented Sep 23, 2024

Describe the bug

If tooltips are close to each other, then hovering past them quickly keeps the old tooltip still open. Here's the screen recording

bits-tooltip-open-bug.mp4

Reproduction

https://stackblitz.com/edit/github-whmvc7?file=src%2Froutes%2F%2Bpage.svelte

Logs

No response

System Info

System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@sveltejs/kit: ^2.0.0 => 2.5.28
bits-ui: latest => 0.21.15
svelte: ^4.2.7 => 4.2.19

Severity

annoyance

@shyakadavis
Copy link
Contributor

shyakadavis commented Sep 23, 2024

Hello @nooblyf

I think what you're looking for is the group prop on Root https://www.bits-ui.com/docs/components/tooltip#tooltiproot

IIRC, no 2 tooltips that belong to the same group can be open at a time.


Just doing <Tooltip.Root group openDelay={0}> to all your tooltips should fix, and if you have multiple on the same page, you can provide a custom group name.

@nooblyf
Copy link
Author

nooblyf commented Sep 23, 2024

thanks @shyakadavis for the quick help, i tried adding a unique group to each root but it was still same

Screenshot 2024-09-23 at 14 53 54

i then edited to just group as you said and it works now!

@nooblyf nooblyf closed this as completed Sep 23, 2024
@shyakadavis
Copy link
Contributor

For future reference, you need to give both the same group name, otherwise they are registered as different.

@nooblyf
Copy link
Author

nooblyf commented Sep 23, 2024

ohh okay, thanks!

@nooblyf
Copy link
Author

nooblyf commented Dec 24, 2024

@shyakadavis @huntabyte is there a similar setting like group for shadcn-svelte and bits-ui next? i'm experiencing the same bug in shadcn-svelte@next's tooltip

@nooblyf nooblyf reopened this Dec 24, 2024
@huntabyte
Copy link
Owner

<Tooltip.Provider> @nooblyf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants