1.滑动时候警告[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.

2.解决方案

解决办法1:

在touch的事件监听方法上绑定第三个参数{ passive: false },
通过传递 passive 为 false 来明确告诉浏览器:事件处理程序调用 preventDefault 来阻止默认滑动行为。

elem.addEventListener(
'touchstart',
fn,
{ passive: false }
);

解决办法2:

 * { touch-action: pan-y; }
// 使用全局样式样式去掉

.

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.的更多相关文章

  1. 移动端页面滑动时候警告:Unable to preventDefault inside passive event listener due to target being treated as passive.

    移动端项目中,在滚动的时候,会报出以下提示: [Intervention] Unable to preventDefault inside passive event listener due to ...

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

    Unable to preventDefault inside passive event listener due to target being treated as passive 今天在做项目 ...

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

    最近两天企业微信下IScroll突然无法滚动了,特别慢,之前好好的,发现主要是有红色的Unable to preventDefault inside passive event listener du ...

  4. [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

    相信如果用谷歌浏览器做移动端页面的时候 用touch事件的时候应该遇到过这个东东吧 documet.addEventListener("touchstart",function() ...

  5. Vue移动端报错[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.

    解决方法如下 项目方案: 在最外侧添加样式操作 .

  6. 关于Google浏览器Unable to preventDefault inside passive event listener due to target being treated as passive.的解决方案

    最近写react项目的时候,引用了antd-mobile,在使用滚动组件的时候,发现谷歌浏览器会报以下警告 最初我以为是antd-mobile的问题导致的,然后我就无查看了之前的vue的项目,发现了类 ...

  7. Unable to preventDefault inside passive event listener due to target being treated as passive 怎么办?

    本篇为转载,原文链接:https://blog.csdn.net/lijingshan34/article/details/88350456 翻译一下:chrome 监听touch类事件报错:无法被动 ...

  8. Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

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

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

    使用滚动时候,新版google浏览器,会弹出如下的警告. 解决方法,可以加上* { touch-action: none; } 这句样式去掉. 其原因:https://developers.googl ...

随机推荐

  1. request.getRequestDispatcher(url).forward(request, response)

    request.getRequestDispatcher().forward(request, response) 意思是将客户端的请求转向到 getRequestDispatcher()方法中参数定 ...

  2. AC日记——斐波那契数列(升级版) 洛谷 P2626

    斐波那契数列(升级版) 思路: 水题: 代码: #include <cmath> #include <cstdio> #include <cstring> #inc ...

  3. spark技术热点问题互动问答2

    决胜云计算大数据时代” Spark亚太研究院100期公益大讲堂 [第3期互动问答分享] Q1: groupbykey是排好序的吗?分组排序怎么实现? groupByKey在一个由(K,V)对组成的数据 ...

  4. python 全局解释锁GIL

    Python的全局解释器锁GIL用于保护python解释器,使得任意时刻,只有一个线程在解释器中运行.从而保证线程安全 在多线程环境中,Python 虚拟机按以下方式执行: 1. 设置GIL2. 切换 ...

  5. django URL参数在view中传递和Template的反向解析方式

    一. URL参数在view中传递 1.带参数名:通过named group方式传递指定参数,语法为: (?P<name>pattern), name 为传递参数的名称,pattern代表所 ...

  6. HTTP.SYS

    严格地说,HTTP.SYS已经不属于IIS 的范畴了,所以HTTP.SYS的配置信息也没有保存在IIS 的元数据库(Metabase) 中,而是定义在注册表中.HTTP.SYS 的注册表项的路径为HK ...

  7. 1090: MTM (费用流)

    1090: MTM Time Limit:3000/1000 MS (Java/Others)   Memory Limit:163840/131072 KB (Java/Others)Total S ...

  8. [BZOJ5462][APIO2018]新家(线段树+堆)

    其实这个题第一反应一定是线段树分治,但是这样反而更难考虑了(实际上是可做的但很难想到),可见即使看上去最贴切的算法也未必能有效果. 考虑这个DS题,没有什么模型的转化,可能用到的无非就是线段树.平衡树 ...

  9. 1.7(java学习笔记)package和import

    package package主要用于管理类,在java中同一个包下不能有相同的类名,可有时项目总会出现很多同名的类,这时就需要通过包来管理类.不同的包下可以有相同的类名. 包就有点类似于文件夹,不同 ...

  10. Android Studio 生成aar包,并在其他项目中引用

    1.新建Module 2.作为library来使用 3.在这个library写需要独立出来的东西 4.重新编译工程 5.切换到Project模式查看aar包,生成成功~ 6.引用方法,切换到Proje ...