-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Slider breaks when slidesToShow > number of slides #1182
Comments
This is not a bug. This is the intended unslick behaviour. |
I also have this issue. I don't understand how this is not a bug unless react-slick doesn't intend to match the features of slick? As @selrond pointed to the particular slick demo showing this, when there is less slides than the specified e.g. slidesToShow = 3, if we have 1 slide, then I should expect to see 1 slide taking up 1/3 of the slider, and no slider dots/arrows |
Please see my answer on #1196 |
@binary-moon that's definitely a workaround, but not a fix. It also doesn't work well for responsive designs e.g. you might fit 7 slides in a large screen, and 1 slide in a small screen. |
@twgraham Definitely not a fix, you are right. But it works until the devs fix it (or it looks like they prefer the current behaviour). You can easily write media queries for other screen size combinations as well. |
@akiran any plans to fix this issue? |
Kindly assist what to do in this case. Manual fix is the only option? |
Wasn't an issue in 0.21.0. Revert to this previous version to temporary fix the issue. |
Came into the same problem today. Apparently, react-slick show both the slides and its "clones" if infinite is true and slidesToShow greater than number of slides |
this is all quite frustrating to deal with, and having to keep track of the number of slides provided to ensure that we do not try and show more slides is a pain. |
In my case it's broken even if slidesToShow <= number of slides, enabling responsive options: I have 3 slides and I want to show 1 on small screens and 2 on tablets and desktops:
So the slider render 2 slides first and then when rerender to show only 1 slide the content of the Slider is not rendered anymore. This doesn't happens if we remove arrows false to responsive settings on small screens. |
Add it to css
|
@vitlcoder Thank you, this solution worked for me. |
hello excuse me ? any progress on this ? I have to set: .slick-list {
min-height: `${MY_CARD_HEIGHT}px`;
} |
https://codesandbox.io/s/z3r5nopkm4
expected behavior: Slick (Add & Remove demo)
The text was updated successfully, but these errors were encountered: