React-responsive-carousel: autoPlay doesn't work when start (SP webpart)

Created on 13 Mar 2019  路  11Comments  路  Source: leandrowd/react-responsive-carousel

First of all, I've already checked this issue: https://github.com/leandrowd/react-responsive-carousel/issues/298

My problem is basically the same, autoPlay starts only when I click on an arrow. I'm using this component in a Sharepoint webpart with the following configurations:

showThumbs={false}
onClickItem={this.click_item}
showStatus={false}
autoPlay={true}
interval={2000}
infiniteLoop={true}
dynamicHeight={true}

Edit: I tried v3.1.46 and v3.1.47 and didn't worked, but v3.1.33 did

Most helpful comment

Even I had the same issue my package version was 3.1.49 , I then downgraded to 3.1.46 still the issue was not fixed. I get the data from API and then map it inside the Carousel . So I put a condition like until I get the data from api I'm not going to render the Carousel and it looks something like this,
{this.state.banners.length > 0 ? (
//Here I added my Carousel and mapped the data and displayed the image.
) : null}
And it fixed for me.

All 11 comments

I have the same problem & not work with stopOnHover

also I want to know how to play to first page if autoPlay gone to the end. ie endpage -> 1

I have the same issue where the carousel does not start rotating on page load. Is this fixed ? What's the workaround for this? i am using 3.1.47 version

Same issue here. Any update on this?

I am also facing the same issue. autoplay not working even in latest release which is 3.1.49 and yes, autoplay works in version 3.1.33 but when it comes to the last slide, it flips to the first one , scrolling backwards, navigating all the slides in between, which is not a very good user experience. Not sure, how it is working fine in Demos. :( Am I missing something here? please advise.

downgrading to 3.1.33 worked fine for me

As a workaround I resolved the issue by writing a jquery click event on the page load method.

Even I had the same issue my package version was 3.1.49 , I then downgraded to 3.1.46 still the issue was not fixed. I get the data from API and then map it inside the Carousel . So I put a condition like until I get the data from api I'm not going to render the Carousel and it looks something like this,
{this.state.banners.length > 0 ? (
//Here I added my Carousel and mapped the data and displayed the image.
) : null}
And it fixed for me.

@bhashmitha thank you sir!

@EGBravo the problem occurs when you initialize the Carousel with no children. So don't init the Carousel unless you have children. It will solve the problem. You don't need to downgrade or anything like that.

Thanks @bhashmitha and @nabinbhusal80

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thlee1122 picture thlee1122  路  5Comments

ShineOfFire picture ShineOfFire  路  6Comments

paulgasbarra picture paulgasbarra  路  5Comments

anoush-soghomonyan picture anoush-soghomonyan  路  6Comments

PatrikKozak picture PatrikKozak  路  3Comments