diff --git a/carousel/carousel.js b/carousel/carousel.js index e65f3e5..2fcc57e 100644 --- a/carousel/carousel.js +++ b/carousel/carousel.js @@ -224,6 +224,11 @@ export default class Carousel { return e.target.setAttribute('aria-selected', true) + // deselect any other pagination dots + Array.from(this.elements.pagination.children) + .filter(x => x !== e.target) + .forEach(dot => dot.setAttribute('aria-selected', false)); + const item = this.elements.snaps[this.#getElementIndex(e.target)] this.goToElement({