Akryum / floating-vue

💬 Easy tooltips, popovers, dropdown, menus... for Vue
https://floating-vue.starpad.dev/
MIT License
3.28k stars 335 forks source link

Hold press to show tooltip #979

Open auctumnus opened 1 year ago

auctumnus commented 1 year ago

I'm trying to use this library to make a wrapper that follows Material 3, but I need to be able to have the tooltip appear on a long press, the way that the design system describes, but I'm not sure that this is possible through this library. Normally, I could solve this by adding my own logic to shown and so on, but a slot won't take an event listener.

I'm not sure what the API would look like for this, and it seems like a really specific use case, so I'm unsure how well this fits, but it's impossible to do it without the internals.

Akryum commented 1 year ago

Normally, I could solve this by adding my own logic to shown and so on, but a slot won't take an event listener.

Not sure why you couldn't implement what you are looking for

auctumnus commented 1 year ago

ended up doing this with an extraneous <div> around the target slot which i feel like i should not need to do

Akryum commented 1 year ago

You can put :triggers=[] and control the popper however you like, for example by adding event listeners on the button in the default slot.