Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In infinite mode, when slidesToShow equal to the length of slides, infinite functionality is not working. #1813

Comments

@amitk7407
Copy link

demo: https://codesandbox.io/s/react-slick-playground-yjk35?file=/index.js

Even after using { arrows: true, dots: true, infinite: true} when slideToShow equals to the length of slides, no pre/post cloned slides are being rendered which usually happens when infinite is set to true. Arrows and Dots are also not being rendered in this case.

@amitk7407
Copy link
Author

amitk7407 commented Jun 11, 2020

Hi,

I have got a workaround for this issue, so sharing it thinking it may help.

Suppose, slidesToShow = totalSlides = 3, then instead of passing 3 to slidesToShow, we can pass 2.99 which will show arrows and dots and add cloned slides. And if you are using centerMode: true, then the slides in this case will not be centered so for this, add css like:
.slick-slide { transform: translate(100%, 0); }
This will move your slide by 1 which works in case of 3 visible slides. You can translate based of your number of visible slides.

@quyctd
Copy link

quyctd commented Aug 6, 2020

+1, I have the same issue. The workaround method from @amitk7407 is working 👍

@MatheusR42
Copy link

+1, SAME ISSUE

@stressed-pet-owner
Copy link

Same issue. Although @amitk7407 solution made my slider infinite.. it doesn't look good because it is cut

https://share.getcloudapp.com/jkuL1n97

@TanelMarran
Copy link

TanelMarran commented Nov 29, 2022

+1, same issue.

@rjsdnql123
Copy link
Contributor

It has been resolved in the latest version! Now you can use infinite even when 'element' and slideToShow are the same.

akiran added a commit that referenced this issue Jan 25, 2024
@akiran
Copy link
Owner

akiran commented Jan 25, 2024

Fixed in [email protected]

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