From 5ddcb8d14b90b57c201804f877e95cde91c4e322 Mon Sep 17 00:00:00 2001
From: Daniel Freedman <dfreedm@google.com>
Date: Fri, 4 Nov 2016 10:46:47 -0700
Subject: [PATCH] always use the document listener

---
 src/standard/gestures.html | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/standard/gestures.html b/src/standard/gestures.html
index 2e41c258f0..63c9a9cdbb 100644
--- a/src/standard/gestures.html
+++ b/src/standard/gestures.html
@@ -190,9 +190,9 @@
     stateObj.upfn = null;
   }
 
-  if (HAS_NATIVE_TA) {
-    document.addEventListener('touchend', ignoreMouse, SUPPORTS_PASSIVE ? {passive: true} : false);
-  }
+  // use a document-wide touchend listener to start the ghost-click prevention mechanism
+  // Use passive event listeners, if supported, to not affect scrolling performance
+  document.addEventListener('touchend', ignoreMouse, SUPPORTS_PASSIVE ? {passive: true} : false);
 
   var Gestures = {
     gestures: {},
@@ -250,9 +250,6 @@
           if (!HAS_NATIVE_TA) {
             if (type === 'touchstart' || type === 'touchmove') {
               Gestures.handleTouchAction(ev);
-            } else if (type === 'touchend') {
-              // ignore syntethic mouse events after a touch
-              ignoreMouse(ev);
             }
           }
         }