akiran / akiran/react-slick

variableWidth on mobile device break the slider

Open
#1,789 17 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
11.9k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

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!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.