leo6104 / ngx-slick-carousel

Angular 17+ wrapper for slick plugin
106 stars 43 forks source link

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

Open gopikrishna-manifest opened 2 years ago

gopikrishna-manifest commented 2 years ago

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