React-slick: Not Scrollable when the number of slides is less than slidesToShow

Created on 13 Mar 2018  路  4Comments  路  Source: akiran/react-slick

When the number of slides is lower than slidesToShow it no longer scrollable this means that centerMode stops working. I want the slide that is selected to be in the Center. Is there a way to make it so that it still scrolls to the so the selected slide is in the center? even when there is fewer that or equal slide to show? (In my case I have 5 slides always and want to show all 5 slides always, but with the selected one in the middle)

Here is my settings:

{
            arrows: false,
            infinite: true,
            speed: 300,
            slidesToShow: 5,
            slidesToScroll: 1,
            focusOnSelect: true,
            centerMode: true
        }

CodeSandBox

Most helpful comment

This is perfectly fine, but there is no more unslicked class, when slider is actually unslicked
in this example: https://codesandbox.io/s/l2jp0q7z29
You will notice that when slider is unslicked then:

  • class .unslicked is not added
  • cloned elements appear in view
    screen shot 2018-04-26 at 13 24 13

All 4 comments

This is not a bug. This is a feature.
The slider will be unslicked if the slidesToShow >= slideCount.

This is perfectly fine, but there is no more unslicked class, when slider is actually unslicked
in this example: https://codesandbox.io/s/l2jp0q7z29
You will notice that when slider is unslicked then:

  • class .unslicked is not added
  • cloned elements appear in view
    screen shot 2018-04-26 at 13 24 13

@imornar Have you fixed the problem with elements cloning?

Nope, had to hide it with css

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicreichert picture nicreichert  路  3Comments

slashwhatever picture slashwhatever  路  3Comments

walker-jiang picture walker-jiang  路  3Comments

amishPro picture amishPro  路  3Comments

artemidas picture artemidas  路  4Comments