Skip to content

Commit

Permalink
fix(pagination): fix pagination bullets children clicks
Browse files Browse the repository at this point in the history
fixes #6361
  • Loading branch information
nolimits4web committed Feb 9, 2023
1 parent 539a859 commit 8bcff39
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/modules/pagination/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ export default function Pagination({ swiper, extendParams, on, emit }) {
}

function onBulletClick(e) {
const isBullet = e.target.matches(classesToSelector(swiper.params.pagination.bulletClass));
if (!isBullet) return;
const bulletEl = e.target.closest(classesToSelector(swiper.params.pagination.bulletClass));
if (!bulletEl) {
return;
}
e.preventDefault();
const index = elementIndex(e.target) * swiper.params.slidesPerGroup;
const index = elementIndex(bulletEl) * swiper.params.slidesPerGroup;
if (swiper.params.loop) {
swiper.slideToLoop(index);
} else {
Expand Down

0 comments on commit 8bcff39

Please sign in to comment.