atomiks / tippyjs

Tooltip, popover, dropdown, and menu library
https://atomiks.github.io/tippyjs/
MIT License
11.91k stars 518 forks source link

tippy.delegate + trigger:"click" + hideOnClick: true = immediately hides tippy on mobile #995

Closed twilson90 closed 2 years ago

twilson90 commented 2 years ago

For mobile platforms (only chrome confirmed), if you use:

tippy.delegate(elem, {
   target: ".thing",
   trigger: "click",
   hideOnClick: true
})

...Then the tippy instance briefly appears and then disappears.

Using trigger: "focus" fixes it.

I've tried setting up my own click listener in onShow to recreate hideOnClick, but again, it is immediately triggered. I think tippy must be listening for another event (appropriate for mobile) that fires momentarily before the "click" event, but internally it's still listening for "click" for hideOnClick, so it is immediately hidden.