Skip to content

Carousel 滑动报错 #2699

@guanjp

Description

@guanjp
  • 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?

正常滑动,控制台报错


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

Activity

ant-design-bot

ant-design-bot commented on Jul 2, 2018

@ant-design-bot

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.

ziluo

ziluo commented on Jul 3, 2018

@ziluo
Contributor

Related to Passive Event Listeners, fix it later

territoryfan

territoryfan commented on Jul 19, 2018

@territoryfan

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

added this to the 2.2.4 milestone on Aug 15, 2018
750973092

750973092 commented on Sep 13, 2018

@750973092

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

hellosean1025

hellosean1025 commented on Sep 21, 2018

@hellosean1025

什么时候能够修好?

hellosean1025

hellosean1025 commented on Sep 21, 2018

@hellosean1025

@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;
  }
}
qhy90223

qhy90223 commented on Oct 26, 2018

@qhy90223

me too

toFrankie

toFrankie commented on Dec 18, 2018

@toFrankie

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

watsonhaw

watsonhaw commented on Mar 13, 2019

@watsonhaw

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

removed this from the 2.2.4 milestone on May 28, 2019
vnues

vnues commented on May 30, 2019

@vnues

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

flyingcrp

flyingcrp commented on Jul 25, 2019

@flyingcrp

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

worked for me .

anyway ,there are many bugs waiting to be fixed

hansinhu

hansinhu commented on Sep 11, 2019

@hansinhu

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

Shuo-Mr

Shuo-Mr commented on Aug 5, 2021

@Shuo-Mr

@vnues

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

请问加在哪里?我加在Carousel上面没有效果,Carcousel下的每个子项也都测试加过,并没有效果。
谢谢。

其他尝试:
也试过监听Carousel的touchmove事件,并设置passive : false, 也没有效果。
最后我找到node_modules 下的 rmc-nuka-carousel 包,删除event.preventDefault(), 的确抛出错误了,但是这并无意义。

awmleer

awmleer commented on Nov 17, 2021

@awmleer
Member

v2 已停止维护了,可以考虑升级一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @ziluo@watsonhaw@likezero@flyingcrp@doxiaodong

      Issue actions

        Carousel 滑动报错 · Issue #2699 · ant-design/ant-design-mobile