akiran / react-slick

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

Slider image streching when slider counter is smaller than the slidesToShow #1196

Closed ajeemaw closed 6 years ago

ajeemaw commented 6 years ago

I have put 7 slides to show in 1366px screen. but the thing is, sometime the slider count is smaller than the amount of "slideToShow". In this scenario, If there is 3 slide, It will divide the width into 3. But Actually I want this to divide into 7 and display the 3 slides in that respective widths.

Guidelines for posting a new issue

laveesingh commented 6 years ago

This issue was fixed in previous releases. Could you replicate this issue with codesandbox demo?

twgraham commented 6 years ago

Sounds related to #1182

binary-moon commented 6 years ago

@ajeemaw In your CSS, add the following to achieve what you want: .slick-slide: { max-width: 14.2857% }

This will always make each slide span 1 / 7 of the available space, and will solve your problem

ajeemaw commented 6 years ago

Ya I've solved this with the new version of Slick Slider. Thank you all.

MickeyKay commented 6 years ago

@ajeemaw I'm still seeing this issue. Can you confirm where this was fixed (e.g. commit link)? This is definitely something I'd like to solve.

ajeemaw commented 6 years ago

@MickeyKay Sorry actually i dont remember the code, but for me it was not working in "react-slick": "^0.20.0", but it is working fine after upgrading the version to "react-slick": "^0.22.0" And please use the relevant APIs (slidesToShow, responsive, breakpoints) Please check with that version.

MickeyKay commented 6 years ago

@ajeemaw that this works if variableWidth is set to true.

GoutamShanbhag commented 1 year ago

I am still having this issue i am currently using version ^0.29.0. It would really help if anyone can tell me how you fix it