akiran / akiran/react-slick

First page of the carousel doesn't display when page is refreshed on smaller view-ports

Đang mở
#1,948 1 bình luận 3 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ả

I have started to experience an issue when adjusting the slides to mobile. If I refresh the page of the highest width, it will work fine but if I simulate a smaller view-port and refresh the page, it will not display the first page of the slide, and when clicking on an arrow, it will skip the first page and just straight to the second page.

Desktop:
![Peek 2020-12-14 10-31](https://user-images.githubusercontent.com/26734503/102086993-ab97c980-3df7-11eb-82cb-a22a6f41b8a0.gif)

Any smaller view-port:
![Peek 2020-12-14 10-33](https://user-images.githubusercontent.com/26734503/102087125-d84be100-3df7-11eb-8e65-9198e0608457.gif)

I have a component that holds the slider with the following settings:

```javascript
const settings = {
dots: true,
infinite: false,
draggable: false,
slidesToShow: 8,
slidesToScroll: 8,
initialSlide: 0,
lazyLoad: 'progressive',
nextArrow: (



),
prevArrow: (



),
responsive,
}
```

The `responsive` is passed via props, and it's as follows:

```javascript
export default [
{
breakpoint: 1920,
settings: {
slidesToShow: 8,
slidesToScroll: 8
}
},
{
breakpoint: 1792,
settings: {
slidesToShow: 7,
slidesToScroll: 7
}
},
{
breakpoint: 1492,
settings: {
slidesToShow: 6,
slidesToScroll: 6
}
},
{
breakpoint: 1280,
settings: {
slidesToShow: 5,
slidesToScroll: 5
}
},
{
breakpoint: 1080,
settings: {
slidesToShow: 4,
slidesToScroll: 4
}
},
{
breakpoint: 720,
settings: {
slidesToShow: 3,
slidesToScroll: 3
}
},
{
breakpoint: 560,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
}
}
];
```

If the `responsive` array has only one object, it will not occur, but as soon as there are two, it will.

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.