-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
[Popover] Don't stick upon click with openOnHover
prop
#819
Conversation
Netlify deploy preview |
Seems to work fine.
There's no prop exposed to control this behavior? |
Not currently but there could be. @vladmoroz |
bb53509
to
0ff3752
Compare
I wouldn't want to add a prop unless necessary—is there a typical design where it makes sense to keep it open on click? |
Back when I was developing tippy.js, the "stick" behavior was actually the requested default (a while ago, 2019), and it wasn't configurable. I didn't hear of complaints. It's also the default in Floating UI now (working better with the recent fixes). |
await user.hover(trigger); | ||
|
||
// Closes instantly after opening due to `useClick` prop `stickIfOpen=false` | ||
await act(async () => { | ||
trigger.click(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this is why it's configured by default, but it depends on the delay
you use. If you happen to click <50ms after it opens coincidentally, it's pretty unexpected
The upgrade fixes bugs and adds this prop to turn off.