robinrodricks / vue3-touch-events

Simple touch events support for vue.js 3
MIT License
244 stars 31 forks source link

Difficult to trigger swipe on mobile safari #35

Open zrisher opened 1 year ago

zrisher commented 1 year ago

Hi there! Thanks for this wonderful plugin.

I'm having a more difficult time triggering the swipe functionality than I would like. Don't get me wrong - it does work, but it just seems to be very insensitive.

Compare for example these two sliders on mobile Safari:

The Client Testimonials slider on this website, implemented with this library

The Shorts slider on Youtube's homepage

As you can tell, the Youtube slider is significantly easier to trigger. It seems to recognize the start of the swipe more quickly, and considers swiping out of the area a completion of the swipe.

Any suggestion configuration changes I can make? I tried reducing swipeTolerance from 30 to 15 to no avail.

zrisher commented 1 year ago

Looks like this might be related: https://github.com/robinrodricks/vue3-touch-events/issues/22

fjeddy commented 10 months ago

It's not insensitive from my experience, when you do a left swipe or a right swipe, you have to swipe in a almost perfect line.. Swipe slightly upwards or downwards while sliding left / right, then it won't register.

Most people use the thumb to slide left or right, and doing a perfectly straight line is incredibly hard. The thumb is automatically, and naturally, sliding slightly up (Swiping right) or down (Swiping left) as you move the thumb. Try it yourself, focus, and do a perfectly straight line, and it works every time.

I would consider this a major bug / flaw in this library, as it makes the swipe function useless.

fjeddy commented 10 months ago

Update: It seems the option swipeTolerance which is by default set to 30px, is related to this. The number follows X as well as Y. Setting it to something like a 100px made the swipe way more accurate and responsive, allowing swipes that wasn't a perfect straight line.