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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/fastclick.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down