Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"last" value in afterChange event getting false even it is a last page. #81

Open
gopikrishna-manifest opened this issue Nov 22, 2021 · 0 comments

Comments

@gopikrishna-manifest
Copy link

Hi,
I am getting the "last" value in afterChange event as false, when I have 7 slides in my slider with the following configuration

{
      slidesToShow: 4, 
      slidesToScroll: 4, 
      variableWidth: false, 
      arrows: false, 
      infinite: false
}

I checked the code and I think below is the issue
image

Here, the code checking if the currentSlide + slick.options.slidesToScroll value is equal to total slides length.

In my case, the first page shows first 4 slides and when I came to the second page, currentSlide + slick.options.slidesToScroll is 8 which is greater than total sliders length. so "last" value is showing as false event it is the last page.

Please fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant