akiran / akiran/react-slick

[react-slick] Reverse swipe from last slide ignores slidesToScroll and active dots disappear (infinite=false)

Đang mở
#2,436 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
11.9k
Fork
2.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

When the user reaches the very last slide and keeps trying to swipe forward (knowing nothing is there), then tries to swipe **backward** again, two issues occur:

1. On the **first reverse swipe**, the slider only scrolls **1 slide** — even though `slidesToScroll` is set to 2.

* From the **second reverse swipe onwards**, the slider scrolls correctly by 2 slides.

2. After swiping beyond the last slide, the **active dot indicator disappears**.

* When swiping back, the active dot does not match until the second swipe.

---

#### My settings

```tsx
const settings = {
dots: true,
infinite: false, // important: finite mode
slidesToShow: 2, // or 3/4 depending on screen size
slidesToScroll: 2, // should always scroll in pairs
speed: 500,
arrows: false,
adaptiveHeight: true,
};
```

---

#### Expected behavior

* Every swipe (forward or backward) should respect `slidesToScroll`.
* The **active dot** should always remain visible and correctly reflect the current position.

---

#### Actual behavior

* Forward overswipe at the end does nothing (✅ correct).
* First reverse swipe → scrolls only 1 slide (❌ unexpected).
* Subsequent reverse swipes → scrolls 2 slides (✅ correct).
* After overswiping forward at the end → the **active dot disappears** (❌ unexpected).

---

#### Question

* Is this a known bug in React-Slick / Slick?
* Is there a recommended workaround or fix so that:

1. Reverse swipes from the last slide always respect `slidesToScroll`.
2. Active dots never disappear after overswiping beyond the last slide.

### Check your example also with same issue: [Link](https://react-slick.neostack.com/docs/example/responsive)

Thanks!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.