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

Posted wangxiaoyan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unable to preventDefault inside passive event listener due to target being treated as passive. See h相关的知识,希望对你有一定的参考价值。

解决办法

两个方案:
1、注册处理函数时,用如下方式,明确声明为不是被动的
window.addEventListener(‘touchmove‘, func, { passive: false })

2、应用 CSS 属性 touch-action: none; 这样任何触摸事件都不会产生默认行为,但是 touch 事件照样触发。
touch-action 还有很多选项,详细请参考touch-action

链接:https://segmentfault.com/a/1190000008512184




以上是关于Unable to preventDefault inside passive event listener due to target being treated as passive. See h的主要内容,如果未能解决你的问题,请参考以下文章

Unable to preventDefault inside passive event listener

错误提示Unable to preventDefault inside passive event listener解决方法

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as

mui执行滑动事件: Unable to preventDefault inside passive event listener

怎么解决unable to preventdefault inside passive event listener due to target

报错: Unable to preventDefault inside passive event listener due to target being treated as passive(示例