akiran / akiran/react-slick

variableWidth on mobile device break the slider

Ouverte
#1,789 17 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
11.9k
Forks
2.1k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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!

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.