移动端滑动报错:Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080 js事件中preventDefault 这个参数出现了冲突. 解决方法参考:https://www.jianshu.com/p/04bf173826aa 用了第二种方法,在cs…
解决办法: 两个方案:1.注册处理函数时,用如下方式,明确声明为不是被动的window.addEventListener('touchmove', func, { passive: false }) 2.应用 CSS 属性 touch-action: none; 这样任何触摸事件都不会产生默认行为,但是 touch 事件照样触发.touch-action 还有很多选项,详细请参考touch-action 链接:https://segmentfault.com/a/1190000008512184…
相信如果用谷歌浏览器做移动端页面的时候 用touch事件的时候应该遇到过这个东东吧 documet.addEventListener("touchstart",function(){ console.log(123); }); [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' t…
最近做项目经常在 chrome 的控制台看到如下提示: Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080 于是 Google 了一番,找到这篇文章,有了详细解释.Making touch scrolling fast by default 简…
1 前言 在制作2048时,需要在手机端添加滑动检测事件,然后发现控制台有警告,如下: main2048.js:218 [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080 2 解决办法: 在touch的事件监听方法…
页面提示: 点击该事件:页面提示:[8mui.min.js:7 [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080.] 解方法:给您的样式中加入下面的样式即可解决去掉错误提示. * { touch-action:…
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080 解决方法: 方法一在touch的事件监听方法上绑定第三个参数{ passive: false },通过传递 passive 为 false 来明确告诉浏览器:事件…
移动端项目中,在滚动的时候,会报出以下提示: [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080 解决 在touch的事件监听方法上绑定第三个参数{ passive: false }, 通过传递 passive 为…
最近做项目经常在 chrome 的控制台看到如下提示: Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080 于是 Google 了一番,找到这篇文章,有了详细解释.Making touch scrolling fast by default 简…
使用 <div class="list-block"> <ul> <li class="swipeout"> <div class="swipeout-content item-content"> <div class="item-inner">张三</div> </div> <div class="swipeout-actio…