Unable to preventDefault inside passive event listener due to target being treated as passive.

处理h5 在新版本的Chrome和safari中的拖动问题  iphone 微信,谷歌说明地址:https://developers.google.com/web/updates/2017/01/scrolling-intervention

为了不修改过多代码,针对已经上线的业务,采用如下方式解决:

document.addEventListener('touchmove', function(event) {
event.preventDefault();
}, { passive: false } );

  

posted @ 2018-04-09 12:32  皓贤  阅读(222)  评论(0编辑  收藏  举报