From 7b7cccf610078a189731eecb542546353a5ad772 Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Tue, 2 Mar 2021 15:34:10 +0300 Subject: [PATCH] fix(navigation): don't hide navigation on pagination click fixes #4285 --- src/components/navigation/navigation.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/navigation/navigation.js b/src/components/navigation/navigation.js index 9873805f2..423f7b270 100644 --- a/src/components/navigation/navigation.js +++ b/src/components/navigation/navigation.js @@ -138,11 +138,19 @@ export default { }, click(swiper, e) { const { $nextEl, $prevEl } = swiper.navigation; + const targetEl = e.target; if ( swiper.params.navigation.hideOnClick && - !$(e.target).is($prevEl) && - !$(e.target).is($nextEl) + !$(targetEl).is($prevEl) && + !$(targetEl).is($nextEl) ) { + if ( + swiper.pagination && + swiper.params.pagination && + swiper.params.pagination.clickable && + (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl)) + ) + return; let isHidden; if ($nextEl) { isHidden = $nextEl.hasClass(swiper.params.navigation.hiddenClass);