g787543/infinite-react-carousel

autoplay not working when adding beforeChange or afterChange

ferrarisMat opened this issue · 2 comments

Describe the bug
Having autoplay and beforeChange={(e) => console.log(e)} at the same time, disables the autoplay.

Hi @ferrarisMat,

Have you set pauseOnHover={false} ?
if not autoplay will stop when you hover on carousel.

Hi @g787543,

Yep, it has been deactivated, I needed to trigger this function to get the current slide index before it scrolls to the next one, I found a way with the data-carousel-key property and the .active CSS class