Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #84 from DjOli/master
Browse files Browse the repository at this point in the history
Fixed out of bounds issue when adding agile__slide--current class
  • Loading branch information
Łukasz Florczak authored May 8, 2019
2 parents 07d687a + 22beb23 commit 424c71a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Agile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@
start -= (Math.floor(this.settings.slidesToShow / 2) - +(this.settings.slidesToShow % 2 === 0))
}
for (let i = start; i < start + this.settings.slidesToShow; i++) {
// To account for the combination of infinite = false and centerMode = true, ensure we don't overrun the bounds of the slide count.
for (let i = Math.max(start, 0); i < Math.min(start + this.settings.slidesToShow, this.slidesCount) ; i++) {
this.allSlides[i].classList.add('agile__slide--current')
}
},
Expand Down

0 comments on commit 424c71a

Please sign in to comment.