Closed Frank-Shanghai closed 6 years ago
meta setting in index.html doesn't meet the condition to apply fast click:
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
Source code in fastclick.js since line 748: if (chromeVersion) {
if (deviceIsAndroid) {
metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport) {
// Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
return true;
}
// Chrome 32 and above with width=device-width or less don't need FastClick
if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
return true;
}
}
// Chrome desktop doesn't need FastClick (issue #15)
} else {
return true;
}
ToDo: Try to debug on device, check if it will meet the conditions above (first you should remove user-scalable="no").
https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away
从上面链接中可以看出,如果有以下设置: To remove the 300-350ms tap delay, all you need is the following in the
of your page:看来这个问题早已经不是问题了。
所以,从fastclick.js的源码中也看出,有上述设置了话,直接 return, 不做任何其他处理。 所以,目前的project中不存在fastclick issue. 恢复所有代码。
About the akas 300ms delay issue: https://labs.ft.com/fastclick/
And the most used solution is fastclick.