From e6247d98a11e7d9c5a23fbef7d60a70edac8100c Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Fri, 14 Apr 2023 13:12:13 +0300 Subject: [PATCH] fix(pagination): update pagination direction class on direction change fixes #6511 --- src/modules/pagination/pagination.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/pagination/pagination.js b/src/modules/pagination/pagination.js index f7af40910..634c5a9c6 100644 --- a/src/modules/pagination/pagination.js +++ b/src/modules/pagination/pagination.js @@ -410,6 +410,17 @@ export default function Pagination({ swiper, extendParams, on, emit }) { ); } + on('changeDirection', () => { + if (!swiper.pagination || !swiper.pagination.el) return; + const params = swiper.params.pagination; + let { el } = swiper.pagination; + el = makeElementsArray(el); + el.forEach((subEl) => { + subEl.classList.remove(params.horizontalClass, params.verticalClass); + subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); + }); + }); + on('init', () => { if (swiper.params.pagination.enabled === false) { // eslint-disable-next-line