react-slideshow icon indicating copy to clipboard operation
react-slideshow copied to clipboard

First and last slides are rendered extra again

Open vinidisanti opened this issue 3 years ago • 4 comments

Hello! The first and last slides are rendered extra, even if I say infinite is false. I noticed that this issue was corrected on version 3.6.1. But It's not working again.

vinidisanti avatar Apr 04 '22 14:04 vinidisanti

Hi, thanks for reporting this. I'll revisit it and see what happened. I know it was fixed earlier

femioladeji avatar Apr 04 '22 14:04 femioladeji

Thank you. Now I realized that it was not working properly when I click on right arrow on version 3.6.1. There are not extra slides, but the animation is still happening.

vinidisanti avatar Apr 04 '22 14:04 vinidisanti

@vinidisanti I just took a look at the code and the extra slides are not rendered if infinite prop is false and the number of slidesToShow is equal to slidesToScroll. https://github.com/femioladeji/react-slideshow/blob/master/src/slide.js#L290

What version are you using and what's the value you're using for your props

femioladeji avatar Apr 10 '22 13:04 femioladeji

It works great when slidesToShow and slidesToScroll are the same. But if you have 3 elements, and you have slidesToShow with 2, slidesToScroll with 1 and infinite false, the first element is rendered as last item too. I'm using 3.7.1 version.

vinidisanti avatar Apr 12 '22 17:04 vinidisanti