当前位置: 代码迷 >> 综合 >> 谷歌浏览器报错 [Intervention] Unable to preventDefault inside passive event listener due to target being ..
  详细解决方案

谷歌浏览器报错 [Intervention] Unable to preventDefault inside passive event listener due to target being ..

热度:6   发布时间:2023-11-18 01:59:43.0

网上的解决办法一般为2种 . 

1. 修改css 

*{touch-action: none;
}
或者
* {touch-action: pan-y;
}该方法测试无效

2. 修改js

在处理函数时写明{ passive: false }window.addEventListener('touchmove', fn, { passive: false })测试成功.

 

  相关解决方案