akiran / akiran/react-slick

variableWidth on mobile device break the slider

Aperta
#1,789 17 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
11.9k
Fork
2.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hey guys ! Thanks for this amazing plugin, it really rocks !

There seems to be a problem in the way the width of the `slick-track` div is calculated on mobile. This causes the slider to completly break on the first change of slide because the translation is also wrongly calculated.

My settings :
```javascript
{
infinite: true,
centerMode: true,
slidesToShow: 1,
slidesToScroll: 1,
variableWidth: true,
draggable: false,
speed: 1000
}
```

This issue can be replicated when you switch to mobile view on https://codesandbox.io/s/react-slick-playground-1huh6.

The funny thing here is that if you just change the setting `slidesToShow` to `0`, a javascript error is displayed but the width is rightly calculated!

Anyway, let me know if you find anything!

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.