From f1c8c898fb1efbaf565c507e45d15fd775770453 Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Wed, 18 Aug 2021 10:59:38 +0300 Subject: [PATCH] fix(pagination): avoid adding direction classes to other swiper's pagination's --- src/modules/pagination/pagination.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/pagination/pagination.js b/src/modules/pagination/pagination.js index 60e0f1c45..f057c2b53 100644 --- a/src/modules/pagination/pagination.js +++ b/src/modules/pagination/pagination.js @@ -286,6 +286,13 @@ export default function Pagination({ swiper, extendParams, on, emit }) { if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1) { $el = swiper.$el.find(params.el); + // check if it belongs to another nested Swiper + if ($el.length > 1) { + $el = $el.filter((el) => { + if ($(el).parents('.swiper')[0] !== swiper.el) return false; + return true; + }); + } } if (params.type === 'bullets' && params.clickable) {