Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

calculate trackingClick again in onTouchEnd #528

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

larryzhuo
Copy link

@larryzhuo larryzhuo commented Jun 13, 2017

issue

I found a bug in ios recently. when i do a fast vertically swipe. it will regard as a click event.

why

I debug the code.

FastClick.prototype.onTouchEnd = function(event) {
       
       if (!this.trackingClick) {     /*when run to there, trackingClick is still true. but  (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) is true.  trackingClick should be false.*/
 		return true;
       }

I think that onTouchMove may not change trackingClick value quickly.

solution

my solution is calculate trackingClick again in onTouchEnd.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant