From 82bff51a085b8b0b2053cf981de1c3423279544e Mon Sep 17 00:00:00 2001 From: uniquezhuo <1669790587@qq.com> Date: Tue, 13 Jun 2017 11:03:03 +0800 Subject: [PATCH] check trackingClick in onTouchEnd --- lib/fastclick.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/fastclick.js b/lib/fastclick.js index 3af4f9d6..9f51fc1c 100644 --- a/lib/fastclick.js +++ b/lib/fastclick.js @@ -521,6 +521,12 @@ FastClick.prototype.onTouchEnd = function(event) { var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement; + //check for trackingClick again, otherwise fast swipe in ios will cause a ghost click; + if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) { + this.trackingClick = false; + this.targetElement = null; + } + if (!this.trackingClick) { return true; }