From 886a475e8fcccbefc36b7a105f63ae6bf92046c4 Mon Sep 17 00:00:00 2001 From: issaTan Date: Sat, 28 Apr 2018 11:28:08 +0800 Subject: [PATCH] fixed trigger click event get a wrong targetElement --- .gitignore | 1 + js/fastclick.js | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 073e1535..18e8ead2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ _site/* docs/demos/test.html docs/assets/js/test.js test +.idea diff --git a/js/fastclick.js b/js/fastclick.js index 8cb923ee..14325f09 100644 --- a/js/fastclick.js +++ b/js/fastclick.js @@ -704,6 +704,7 @@ * @returns {boolean} */ FastClick.prototype.onClick = function(event) { + this.targetElement = event.target; var permitted; // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.