Skip to content

carousel goTo(0) does not work #5607

@fionaVg1

Description

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

Version

3.2.3

Environment

3.2.3

Reproduction link

https://antdv.com/components/carousel#API

Steps to reproduce

  1. 第一个学生的照片是3张,每次切换学生会轮播图会播放对应学生的照片
  2. 切换第二个学生,这个学生的照片是2张,调用goTo(0)不生效,从第二张照片开始播放的
  3. 调试源码发现this.innerSlider.currentSlide = 2,没有重置为0,这应该是个bug,我手动在业务代码中this.innerSlider.currentSlide = 0,就可以从第一页开始播放;

What is expected?

  1. 第一个学生的照片是3张,每次切换学生会轮播图会播放对应学生的照片
  2. 切换第二个学生,这个学生的照片是2张,调用goTo(0)后从第二个学生的第一张开始播放

What is actually happening?

调试源码发现this.innerSlider.currentSlide = 2,没有重置为0,这应该是个bug,我手动在业务代码中this.innerSlider.currentSlide = 0,就可以从第一页开始播放

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions