touch拦截监听_向滚动阻止的“ touchstart”事件添加了非被动事件监听器

bd96500e110b49cbb3cd949968f18be7.png

Suddenly today out of nowhere I started getting this one on every page on our website

Added non-passive event listener to a scroll-blocking 'touchstart' event.

Consider marking event handler as 'passive' to make the page more responsive

And its not just once or twice.. its like thousands of them....

ksFDD.png

They are running amok.

The only way to stop the flood of violations is to comment out this line

I read the other posts on what this violation means, but I really cannot see that I did anything different between two hours ago and now (I did a full rollback just to see if it helped)

Its almost like someone put a bug into jquery.min.js but I seriously doubt that cause then everyone would get it.

Any ideas? I tried debugging everything I could, and I still have no idea what causes this?!?

UPDATE

I replaced all text width This removed 99% of all the violations.

解决方案

Ok digging this up a little more, this is not a new behavior, it has been reported a while ago and jQuery still hasn't fixed it.

The problem lies in the fact that for an handler to be passive it has to be certain of never calling preventDefault() but jQuery doesn't know in advance...

The only tip I could give you is change your console logging level and remove "Verbose". Follow up on this issue for ideas on solving this.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值