jerrybendy / vue-touch-events

Support simple touch events (tap / swipe / touch hold)
MIT License
537 stars 51 forks source link

Touchhold fires tap event #81

Closed jordienr closed 4 years ago

jordienr commented 4 years ago

Pretty much the title. I got a component that uses both tap and touchhold. Touchhold fires the tap event. How can I stop this from happening?

jerrybendy commented 4 years ago

This is a known issue of #80 . Maybe I will release a new major version to take this break change

jerrybendy commented 4 years ago

I have released a new version v3.0.0. You can upgrade to the latest version and retry.

jordienr commented 4 years ago

Thank you!

udit99 commented 2 years ago

👋 I'm on version v3.2.2 and still seeing this issue. Any idea what the root cause could be? I've tried using the stop and prevent modifiers but that doesnt help much. Specifically I have this:

<div
   @click="clickHandler"
    v-touch:touchhold="longPressStartHandler"
    v-touch:end="longPressEndHandler">
   Long Press Me!
</div>

is causing the following to fire in sequence:

  1. longPressStartHandler
  2. longPressEndHandler
  3. clickHandler
jerrybendy commented 2 years ago

@udit99 You can try to use tap instead of click

udit99 commented 2 years ago

If I use it instead of click, it doesnt work on desktop. Adding it in addition to click still has the same problem described above.

jerrybendy commented 2 years ago

@udit99 The tap event is compatible with click, you can use it instead of click on desktop, unless you setted the disableClick to true.

udit99 commented 2 years ago

Thank you 🙌...I had a disableClick set to true for some reason. The longpress works now