kenwheeler / slick

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

"Unslicked" responsive slider doesn't become "slick" again. #3967

Open ejazrasool opened 4 years ago

ejazrasool commented 4 years ago

When a responsive slider is unslicked at a larger width, say 1200px wide using "responsive" parameter, and the responsive parameter has some responsive settings for a smaller width, i.e., 900px, the slider just keeps showing all slides like it has been unslicked for the all screen widths.

This report is just a drop in the ocean of 995 open bugs (one confirmed bug from 2014, still open) so I'm guessing it is already a well known bug, but still adding example code that would reproduce the issue.

Steps to reproduce the problem

  1. use following simple settings for responsive key

responsive: [ { breakpoint: 1200, settings: "unslick" }, { breakpoint: 921, settings: { slidesToShow: 1, slidesToScroll: 1 } } ];

  1. Load the page at, say, 800px width and the slider will be activated
  2. Resize the page to a width above 1200px, slider will be destroyed and all items will be visible. Good
  3. Now resize the screen back to 800px.

What is the expected behaviour?

Slider should be activated since the responsive key holds a setting for current screen width

What is observed behaviour?

Nothing happens. All items keep showing

More Details

P.S. It is possible that this is not a bug. I'm actually hoping it is not a bug and it has to do with my settings and I'm misreading the documentation.

"the last carousel you'll ever need"
slick github: 995

agustinl commented 4 years ago

Hi @ejazrasool Please check this answer, maybe it can help you: https://github.com/kenwheeler/slick/issues/3282#issuecomment-379834886

ejazrasool commented 4 years ago

Thanks @agustinl . I ended up implementing a similar solution.