0

I am trying to create an app that works good both with a mouse and touchscreen. The click event didn't work good because as soon as I started dragging a little bit it didn't fire the click event.

So I created another event for touchstart but the problem on touchscreens is now that the addPin method gets called twice on a tap.

<div @touchstart="addPin('1')" @click="addPin('1')">
  1
</div>

I would prefer not to install any libraries for this to work.

Liga
  • 3,291
  • 5
  • 34
  • 59

1 Answers1

0

whenever you tap your screen , a click event will be executed. you have called same method twice using different events. What you should do is determine if the input is a touch or a click event using javascript which has been answered here

nelsonsule
  • 334
  • 2
  • 8