akiran / akiran/react-slick

Next Page isn't calculated properly between responsive breakpoints

Aberta
#1,892 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
JavaScript
Estrelas
11.9k
Forks
2.1k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Hello, I'm running into an issue when you have enough slides for more than 2 pages, the `nextPage` parameter in `beforeChange` isn't calculated properly for responsive carousels with varying rows (ex. `row: 1` vs `row: 4`).

Whenever you're on a page that's not the first or last page of the carousel and adjust the window size to trigger the responsive breakpoint, it defaults to the last page. Can try adding more slides in the example below to verify, the same issue still occurs.

This is the replicated example here: [CodeSandBox](https://codesandbox.io/s/react-slick-playground-forked-mq20b?file=/index.js)

From the replicated example above, I was expecting that if I was on page 2 (middle page) before the breakpoint trigger, after the breakpoint, `nextPage` in `beforeChange` would be 1 instead of 2.

`nextPage` before breakpoint

![image](https://user-images.githubusercontent.com/32151304/93259387-c95c8080-f76d-11ea-919b-814c5cc8e61e.png)

`nextPage` after breakpoint

![image](https://user-images.githubusercontent.com/32151304/93259508-f446d480-f76d-11ea-9f66-ebe3fd1906b0.png)
)

Wondering if this is the expected behaviour or not.

Any possible fix or work around would be great, thanks!

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.