akiran / akiran/react-slick

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

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

説明

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

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

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

評価

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

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

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