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