Closed mohsenasm closed 7 months ago
If you feel there is an issue or bug here can you submit a PR I'll check it.
Hi @robinrodricks I submitted a PR. I also reported the same issue at https://github.com/jerrybendy/vue-touch-events/issues/100 and it just merged in that repo.
Thanks, published.
vue3-touch-events@4.1.6
I was reviewing the swipe detection code to better understand its logic.
In this line we have:
In which the
swipeOutBounded
variable is$this.options.swipeTolerance
. Shouldn't it be:In the current code, we are prioritizing top/bottom swipes over left/right swipes. There is no need for prioritization. We can check if the swipe was a more vertical one or a more horizontal one, and make the decision based on that.
For example, if the start point, current point, and swipeTolerance are like this:
The current code will set
direction = 'bottom'
instead ofdirection = 'right'
.