Ant-design-mobile: Carousel 滑动报错

Created on 2 Jul 2018  ·  12Comments  ·  Source: ant-design/ant-design-mobile

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.2.1

Environment

windows10 专业版

Reproduction link

https://blog.guanjp.com/

Steps to reproduce

左右滑动Carousel组件,控制台报 [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.

What is expected?

正常滑动,控制台无报错信息

What is actually happening?

正常滑动,控制台报错


不影响用户操作,但是控制台会一直报错,对错误收集会有影响

enhancement

Most helpful comment

touch-action: pan-y;
加上这段样式就能屏蔽了

All 12 comments

Translation of this issue:


Carousel slip error

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.2.1

Environment

Windows10 Professional Edition

Reproduction link

https://blog.guanjp.com/

Steps to reproduce

Slide the Carousel component left and right, the console reports [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.

What is expected?

Normal sliding, no error message on the console

What is actually happening?

Normal sliding, console error


Does not affect user operations, but the console will always report an error, which will affect the error collection.

Related to Passive Event Listeners, fix it later

I met too, version: "antd-mobile": "^2.1.9"

同样的问题,好久了怎么还没修复?

什么时候能够修好?

@750973092 @territoryfan @guanjp
等官方修复黄花菜都凉了,大家直接用老外的吧,还有 antd-mobile carousel组件也是基于这个开发的
https://github.com/FormidableLabs/nuka-carousel

试用反馈:基本跟 antd-mobile carousel差不多,有两个按钮可以通过下面css 隐藏掉:

.slider{
  .slider-control-centerright{
    display:none;
  }
  .slider-control-centerleft{
    display:none;
  }
}

me too

应该不是官方的锅,好像是Chrome浏览器新版本的原因,试看一下这篇文章:chrome 监听touch类事件报错:无法被动侦听事件preventDefault。我在Safari控制台是看不到同样的error的。

好像这个是浏览器的问题,请问有方法可以让浏览器不提示error吗?ant的大大们

touch-action: pan-y;
加上这段样式就能屏蔽了

touch-action: pan-y;
加上这段样式就能屏蔽了

worked for me .

anyway ,there are many bugs waiting to be fixed

rmc-nuka-carousel源码在哪里,nuka-carousel 已经 v4+了,rmc-nuka-carousel 始终未更新

Was this page helpful?
0 / 5 - 0 ratings