Skip to content

Commit

Permalink
always use the document listener
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Nov 4, 2016
1 parent 4be7e9f commit 5ddcb8d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/standard/gestures.html
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 5ddcb8d

Please sign in to comment.