kenwheeler / slick

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

The slider does not take its size in responsive #4128

Open Sebastien-Jm opened 2 years ago

Sebastien-Jm commented 2 years ago

When opening and closing the item inspector, the slider remains in its responsive position after closing the item inspector.

====================================================================

Codepen

https://codepen.io/sebastien-jm/pen/vYmarYr

Screenshots

https://i.imgur.com/5kHTKql.png https://i.imgur.com/0nW7HI4.png

====================================================================

Steps to reproduce the problem

Open and close the element inspector, play with the inspector size, or open the mobile inspector on chrome The problem rarely remembers but is still present.

====================================================================

What is the expected behaviour?

The slider should return to the correct screen size.

====================================================================

What is observed behaviour?

The slider keeps the responsive size despite the resizing of the page.

====================================================================

More Details

kyran-edn commented 2 years ago
$(window).resize(function(){
    $('.slider')[0].slick.refresh();
});

On Window resize this refreshes the slider which seems to resize correctly as a workaround