akiran / react-slick

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

Slider isn't aligned left #2369

Open HoangLong08 opened 2 months ago

HoangLong08 commented 2 months ago

image

const carouselSectionSettings = { dots: false, infinite: false, speed: 500, slidesToShow: 4, slidesToScroll: 4, initialSlide: 0, arrows: true, autoplaySpeed: 5000, autoplay: false, prevArrow: , nextArrow: , };

How to fix it? Thanks

kyttd commented 2 months ago

I am having the same problem. In my case, it occurs when the number of elements actually drawn is less than the value set in slideToShow. I think the calculation of the transform: translate3d value given to .slick-track is not working properly.

The versions are as follows

"next": "14.2.1",.
"react":"^18",.
"react-slick": "^0.30.2"

Best regards.

pueyo5 commented 2 months ago

Same thing happened here. I downgraded to version 0.29.0 and now it's working as expected. There must be something with the latest version.

tqmvt commented 1 week ago

Same thing happened here. I downgraded to version 0.29.0 and now it's working as expected. There must be something with the latest version.

It works! But how can we align left? By default, it's centered

tqmvt commented 1 week ago

Above issue was fixed by downgrading to version 0.30.0

.slick-track {
  margin-left: 0;
}