akiran / akiran/react-slick

variableWidth: true, infinite: false not disabling the next arrow button when the last element enters the viewport

Aperta
#2,367 3 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
11.9k
Fork
2.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Issue:

When variableWidth is "true" and infinite is set to "false", next button does not get disabled when the last element enters the viewport. It keeps on scrolling leaving a whitespace after the last element.

Also is there any easier way to calculate "slidesToShow" variable? Max possible number of elements should be present in the screen and "slidesToScroll" should be "slidesToShow - 1" or 1 whichever is the higher.

```
const settings: Settings = {
className: "slider variable-width",
dots: false,
infinite: false,
centerMode: false,
variableWidth: true,
slidesToShow: numSlides,
slidesToScroll: numSlides,
};
```

```

{data.map((el, i) => {
return (


{el}

);
})}

```

Screenshot 2024-04-09 at 1 54 58 AM

Code sandbox:
https://codesandbox.io/embed/ncsf68?view=Editor+%2B+Preview&module=%2Findex.js

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.