ftlabs / fastclick

Polyfill to remove click delays on browsers with touch UIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passive event listeners

anthonyli opened this issue · comments

Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

Experienced issues with this as well on form elements, but only on android phones running Chrome browser version 56. Android phones running older Chrome versions shouldn´t have these issues.
Useful info here:
https://developers.google.com/web/updates/2017/01/scrolling-intervention

One comment suggests this kind of fix to prevent pinch-zoom from failing:
window.addEventListener('touchstart', function(e) { if (e.targetTouches.length === 2) { e.preventDefault(); } }, { passive: false } );

Fast click is largely an orphaned set of code. It is no longer needed in modern browsers.
See issue #498 as well for some context.

@dtapuska
until March 2016 a similar fix landed in iOS 9.3.
https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away?hl=en
Consider the old browsers ,maybe we should use fastclick for a while .But this library has been not updated for more than two years.