Skip to content

Commit

Permalink
fix(pagination): don't hide pagination on navigation click
Browse files Browse the repository at this point in the history
Fixes #4285
  • Loading branch information
nolimits4web committed Mar 2, 2021
1 parent e67a336 commit 68b8a93
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/pagination/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,19 @@ export default {
swiper.pagination.destroy();
},
click(swiper, e) {
const targetEl = e.target;
if (
swiper.params.pagination.el &&
swiper.params.pagination.hideOnClick &&
swiper.pagination.$el.length > 0 &&
!$(e.target).hasClass(swiper.params.pagination.bulletClass)
!$(targetEl).hasClass(swiper.params.pagination.bulletClass)
) {
if (
swiper.navigation &&
((swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl) ||
(swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl))
)
return;
const isHidden = swiper.pagination.$el.hasClass(swiper.params.pagination.hiddenClass);
if (isHidden === true) {
swiper.emit('paginationShow');
Expand Down

0 comments on commit 68b8a93

Please sign in to comment.