Skip to content

Commit

Permalink
fix(pagination): fix clickable pagination with slidesPerView > 1 and …
Browse files Browse the repository at this point in the history
…loop

fixes #6415
  • Loading branch information
nolimits4web committed Feb 27, 2023
1 parent 6552852 commit cf8cdf5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/modules/pagination/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ export default function Pagination({ swiper, extendParams, on, emit }) {
e.preventDefault();
const index = elementIndex(bulletEl) * swiper.params.slidesPerGroup;
if (swiper.params.loop) {
if (swiper.realIndex === index) return;
if (index < swiper.loopedSlides || index > swiper.slides.length - swiper.loopedSlides) {
swiper.loopFix({
direction: index < swiper.loopedSlides ? 'prev' : 'next',
activeSlideIndex: index,
slideTo: false,
});
}

swiper.slideToLoop(index);
} else {
swiper.slideTo(index);
Expand Down

0 comments on commit cf8cdf5

Please sign in to comment.