Skip to content

Commit

Permalink
fix(modules/a11y): filter out falsy pagination elems (#7201)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanrastrick committed Nov 22, 2023
1 parent 8a0c7c4 commit a044626
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/modules/a11y/a11y.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ export default function A11y({ swiper, extendParams, on }) {

// Pagination
if (hasClickablePagination()) {
const paginationEl = Array.isArray(swiper.pagination.el)
? swiper.pagination.el
: [swiper.pagination.el];
const paginationEl = makeElementsArray(swiper.pagination.el)
paginationEl.forEach((el) => {
el.addEventListener('keydown', onEnterOrSpaceKey);
});
Expand All @@ -324,9 +322,7 @@ export default function A11y({ swiper, extendParams, on }) {

// Pagination
if (hasClickablePagination()) {
const paginationEl = Array.isArray(swiper.pagination.el)
? swiper.pagination.el
: [swiper.pagination.el];
const paginationEl = makeElementsArray(swiper.pagination.el)
paginationEl.forEach((el) => {
el.removeEventListener('keydown', onEnterOrSpaceKey);
});
Expand Down

0 comments on commit a044626

Please sign in to comment.