Skip to content

Commit

Permalink
remove aria-label on slides
Browse files Browse the repository at this point in the history
  • Loading branch information
basher committed May 16, 2024
1 parent 86f4297 commit 42524b4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
11 changes: 0 additions & 11 deletions ui/src/javascript/web-components/webui-carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default class WebUICarousel extends HTMLElement {
}

private init(): void {
// this.setupA11y();
this.setVisibleSlide();

// Show slide counter (text).
Expand All @@ -52,16 +51,6 @@ export default class WebUICarousel extends HTMLElement {
this.handleKeyboard();
}

private setupA11y(): void {
// Add slide counter labels for screen readers.
this.slides.forEach((slide: HTMLElement, i: number) => {
slide.setAttribute(
'aria-label',
`slide ${i + 1} of ${this.slides.length}`,
);
});
}

private setVisibleSlide(): void {
const observerSettings = {
root: this.carousel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as WebUICarousel from './WebUICarousel.stories';
# `<webui-carousel>`
- This is an enhancement of the [default CSS carousel](/story/components-carousel--carousel) - optionally showing a slide count, PREV and NEXT buttons, etc.
- Native scrolling with `LEFT|RIGHT` arrow keys is enhanced, allowing JavaScript to correctly update the slide count when using arrow keys.
- Each slide has an `aria-label`, indicating the current slide number and the total number of slides.
- When PREV and NEXT buttons are shown, keyboard `focus` is modified such that **only visible slides are focusable**.

<Canvas of={WebUICarousel.WebUICarousel} />
Expand Down

0 comments on commit 42524b4

Please sign in to comment.