akiran / react-slick

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

Centermode and VariableWidth not working #2358

Open the-black-viper opened 3 months ago

the-black-viper commented 3 months ago

I am currently trying to implement a slider where uncentered items are constrainted/minimized and when they are centered the full content is then shown. I managed to work this part out however on scrolling the items, the item in focus is not centered and there will be instances where it shifts to the left and to the right (usually if its on the last item).

image

My current settings are:

 <Slider
   dots={true}
   centerMode={true}
   centerPadding="60px"
   infinite={true}
   variableWidth={true}
   autoplay={false}
   slidesToShow={2}
   slidesToScroll={1}
 >

Also tried to modify these settings and it still won't center on scroll.

Here is an example sandbox of the issue Working Example

joshuatuscan commented 3 months ago

I created an issue around a very similar issue I am experiencing #2347