kenwheeler / slick

the last carousel you'll ever need
kenwheeler.github.io/slick
MIT License
28.34k stars 5.88k forks source link

Bug centerMode in version 1.8.1 #4104

Open Oleksandr07 opened 3 years ago

Oleksandr07 commented 3 years ago

When the first slide element is active, the slick-center class is set for the incorrect cloned slide element. That is, if there are 5 elements in the slide and the first element of the slide is active, the slick-center class is set for the clone of the second element of the slide, not for the first element. In version 1.6.0, everything works fine

====================================================================

[ https://codepen.io/Oleksandr07/pen/GRWrggv ]

https://codepen.io/Oleksandr07/pen/GRWrggv https://i.imgur.com/e6NcraB.png

====================================================================

What is the expected behaviour?

The slick-center class must be specified for the clone of the first element of the slide

====================================================================

More Details

erwindeclerck commented 3 years ago

Hi, I think the exact same problem is showing in my application: I have a combined carousel and a slider where I use the carousel 'asnavfor' the other in a Drupal 8 site. The carousel is centred and infinitive. There are 12 slides and by going from 12 (index 11) to 1 (index 0), the first slide is not found by your script. So the controlled slider pauzes 1 slide and then catches up from the second one up. You can see the problem happening quickly by using the cursor keys. The same problem happens by going backwards. Then it is again the first slide after the loop around that doesn't show... but then after slide 1, slide 11 is not shown... Site in development: http://dev.alfavisionmuseumservices.eu/ it's the second slider on the beige background... Any suggestion would be more than welcome!