akiran / akiran/react-slick

gif included -- InitialSlide not rendering when variableWidth=true

オープン
#1,687 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
11.9k
フォーク
2.1k
PR マージ指標
30日以内にマージされた PR はありません

説明

I currently have a slide with the following settings

```
initialSlide: carouselState,
afterChange: (current, next) => setCarouselState(current),
infinite: false,
speed: 350,
slidesToShow: 6,
slidesToScroll: 1,
touchThreshold: 15,
variableWidth: true
```

carouselState is meant to retain the state of the slider when moving between different pages. However, whenever I return to the page containing the slider, even if carouselState is not 0 when the page renders, the carousel will start at zero very momentarily, then switch to carouselState. This only occurs when variableWidth is set to true, which I need for the mobile iteration of my current setup.

Anyone know a fix?

![ezgif com-video-to-gif](https://user-images.githubusercontent.com/34800426/70660372-079da000-1c30-11ea-8d1e-ce41d97cbb9d.gif)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。