Skip to content

Commit

Permalink
refactor(esl-carousel): fix a11y for carousel control
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Jan 29, 2024
1 parent a5a3b78 commit afaaa40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/esl-carousel/core/esl-carousel.slide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class ESLCarouselSlide extends ESLBaseElement {
}

protected updateA11y(): void {
this.setAttribute('role', 'group');
this.setAttribute('role', 'listitem');
if (!this.hasAttribute('aria-roledescription')) {
this.setAttribute('aria-roledescription', 'slide');
}
Expand Down
4 changes: 3 additions & 1 deletion src/modules/esl-carousel/core/esl-carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ export class ESLCarousel extends ESLBaseElement {
}

protected updateA11y(): void {
// TODO: update a11y -> check a11y everywhere
if (!this.$slidesArea.hasAttribute('role')) {
this.$slidesArea.setAttribute('role', 'list');
}
}

@listen({
Expand Down

0 comments on commit afaaa40

Please sign in to comment.