This repository was archived by the owner on Mar 24, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 918
sl-carousel and sl-carousel-item do not meet accessibility best practice #2352
Copy link
Copy link
Closed
Labels
bugThings that aren't working right in the library.Things that aren't working right in the library.help wantedReady for a contributor to tackle.Ready for a contributor to tackle.
Description
Describe the bug
sl-carousel and sl-carousel-item do not meet accessibility best practice according to MDN resources.
When pagination is enabled:
role="tabpanel"should be present on each sl-carousel-item.idthat can be referenced by the aria-controls attribute on each tab should be present on each sl-carousel-item.aria-controlsshould not be present on the pagination part; it should be on each tab element instead, and populated with the correspondingidof eachtabpanel.idis not present on each tab.aria-labelledbyshould be present on each sl-carousel-item and populated with theidof the corresponding tab.- Tab labelling: The active tab shouldn't have a label saying "Go to slide {{ active slide number }} of {{ total slides }}" because the tab is already focused.
- Tab labelling: The
tablistrole already provides the number of tabs in the list, so its not necessary to include this in the label. The labeling could be "Go to Slide 2" which the screen reader would announce as "Go to Slide 2, tab selected 1 of 7".
To Reproduce
Steps to reproduce the behavior:
- Have an
sl-carouselcomponent on the page with one or moresl-carousel-items - Inspect the carousel with browser dev tools and verify the above issues
- Use a screen reader to check the announcement of these controls
Browser / OS
- All
Additional information
References:
MDN: tab role
MDN: tab role example
MDN: tab panel role
MDN: tablist role
MDN: aria-controls
PR
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugThings that aren't working right in the library.Things that aren't working right in the library.help wantedReady for a contributor to tackle.Ready for a contributor to tackle.