From 8bcff39651e511385d2371c5c1ac5e387d19251b Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Thu, 9 Feb 2023 11:24:05 +0300 Subject: [PATCH] fix(pagination): fix pagination bullets children clicks fixes #6361 --- src/modules/pagination/pagination.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/pagination/pagination.js b/src/modules/pagination/pagination.js index 96f0ddea5..27e4f5c7d 100644 --- a/src/modules/pagination/pagination.js +++ b/src/modules/pagination/pagination.js @@ -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 {