akiran / react-slick

React carousel component
http://react-slick.neostack.com/
MIT License
11.62k stars 2.09k forks source link

currentSlide from afterChange event shows decimal when using SlidesToShow as decimal and infinite:false #2373

Open jons-disco opened 2 months ago

jons-disco commented 2 months ago

Many would like to have a peek of next slide, but without centerMode.
Using slidesToShow as a decimal like 1.3 works but causes issue with currentSlide coming from afterChange event being a decimal when infinite:false

const settings = { dots: false, slidesToShow: 1.3, infinite: false, };

https://codesandbox.io/p/sandbox/react-slick-playground-forked-6xfj9n?file=%2Findex.js%3A13%2C23