Skip to content

Uds 2143 - Implement: MVP Accessibility Carousels - #1726

Open
spaceperson wants to merge 12 commits into
devfrom
uds-2143
Open

Uds 2143 - Implement: MVP Accessibility Carousels#1726
spaceperson wants to merge 12 commits into
devfrom
uds-2143

Conversation

@spaceperson

@spaceperson spaceperson commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

Checklist

  • Tests pass for relevant code changes

Important Reminders

Links

@spaceperson
spaceperson requested a review from a team as a code owner June 22, 2026 19:57
@asu-jenkins-devops

Copy link
Copy Markdown
Collaborator

@mlsamuelson mlsamuelson changed the title Uds 2143 Uds 2143 - Implement: MVP Accessibility Carousels Jul 28, 2026

@davidornelas11 davidornelas11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few inline comments. Main ones: aria-labelledby isn't pointing to an actual element id, the pagination group still doesn't have its aria-label (this was already flagged on UDS-2150), and role="figure" on the image gallery carousel gets silently dropped now. Also flagged the aria-live/role="alert" bit since #1763 already replaces it with a cleaner approach. Prev/next button disabled state work looks great though. One more thing worth a look (outside this diff): ImageBulletItems in BulletItems.jsx still has the old "Slide view X" label and aria-selected never updates - probably needs the same treatment at some point.

let cardDiv = slides[i].querySelectorAll(`.card`)
if (cardDiv && cardDiv[0]) {
cardDiv[0].setAttribute("aria-live", "polite");
cardDiv[0].setAttribute("role", "alert");

@davidornelas11 davidornelas11 Jul 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role="alert" plus an explicit aria-live="polite" on the same element conflicts (alert already implies assertive), and this announces the whole card body on every slide change instead of something short. Looks like #1763 already dropped this exact block for a cleaner aria-hidden/gliderTrack approach, might be easiest to just pull that over instead of patching this in place.

if (header) {
let allTexts = []
getText(slides[i], allTexts)
gliderElement.setAttribute("aria-labelledby", allTexts[0]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aria-labelledby needs to reference an element id, not raw text - allTexts[0] is just the heading's text content, so this won't resolve to anything for a screen reader. Also getText is called on the whole slide instead of just header, so it could grab text that comes before the heading.

gliderElement.setAttribute("aria-labelledby", allTexts[0]);
gliderElement.removeAttribute("aria-label");
} else {
gliderElement.setAttribute("aria-label", `Card ${i + 1}`);

@davidornelas11 davidornelas11 Jul 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback runs for any carousel without a heading in the slide, not just cards, an image/gallery slide with no caption would get announced as "Card 1". Might be worth making this generic ("Slide 1") instead.



// Update bullet accessibility
const bullets = gliderElement.querySelectorAll(".glide__bullet");

@davidornelas11 davidornelas11 Jul 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up, for the image gallery bullets .glide__bullet matches the <img>, not the <button role="option"> wrapping it, so disabled/aria-current won't actually do anything there.

aria-labelledby={ariaLabelledBy}
// role={role}
// role="group"
role="region"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role is still a prop here but it's dead now that role is hardcoded to "region" - ImageGalleryCarousel passes role="figure" and that'll get silently overridden. Also the commented-out lines above can probably go.

// role={role}
// role="group"
role="region"
aria-label="Carousel pagination"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This aria-label should be on the bullets group container, not here - that's the exact gap Andrew flagged on UDS-2150 (pagination group missing its label). BaseBulletItemContainer still only has role="group" with nothing on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants