akiran / akiran/react-slick

gif included -- InitialSlide not rendering when variableWidth=true

Abierto
#1,687 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
11.9k
Forks
2.1k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.