Skip to content

Commit

Permalink
fix(pagination): update pagination direction class on direction change
Browse files Browse the repository at this point in the history
fixes #6511
  • Loading branch information
nolimits4web committed Apr 14, 2023
1 parent 3dff39a commit e6247d9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/modules/pagination/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e6247d9

Please sign in to comment.