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 closes on click #54

Open
patrickedqvist opened this issue Feb 26, 2025 · 2 comments
Open

Tooltip closes on click #54

patrickedqvist opened this issue Feb 26, 2025 · 2 comments
Labels
bug Something isn't working third-party An issue to relates to a third-party package

Comments

@patrickedqvist
Copy link
Collaborator

Problem

When using the Tooltip on a interactive component, for example on the CopyButton the tooltip vanishes on click. The more appropiate behaviour would be too keep showing the tooltip. Currently it works due to us manually keeping the tooltip open when a user clicks on the button but there is a noticeable flicker.

See open issue at radix radix-ui/primitives#3021

@patrickedqvist patrickedqvist added bug Something isn't working third-party An issue to relates to a third-party package labels Feb 26, 2025
@patrickedqvist
Copy link
Collaborator Author

Floating UI might be a better alternative instead of radix-ui in this case

@jadhaidar
Copy link

@patrickedqvist just came across this same issue as well and landed here. I believe this is a valid use-case that can be supported through a prop to control the behavior.

For reference, my situation is that I have tooltips on buttons to give a hint to users as to what those buttons do. Given they only have icons on mobile. When the user presses a button, the tooltip flickers for a split second and disappears. I'd say this is broken really. Ideally the tooltip should remain visible after the first press, and disappear if they press again or elsewhere. If that's too opinionated then at least let me configure the behavior myself.

I also took a look at Floating UI and I still prefer the higher level abstractions that radix provides. They do have a component library but I'll have to install all of it in order to access their Tooltip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working third-party An issue to relates to a third-party package
Projects
None yet
Development

No branches or pull requests

2 participants