Skip to content

fix: include stepStateText in StepListItem accessible name#9888

Open
Krishnachaitanyakc wants to merge 1 commit intoadobe:mainfrom
Krishnachaitanyakc:fix/steplist-label-in-name
Open

fix: include stepStateText in StepListItem accessible name#9888
Krishnachaitanyakc wants to merge 1 commit intoadobe:mainfrom
Krishnachaitanyakc:fix/steplist-label-in-name

Conversation

@Krishnachaitanyakc
Copy link
Copy Markdown

Closes #9881

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

  1. Render a StepList with multiple items and various completion states
  2. Inspect each step link's aria-labelledby attribute — it should reference three IDs: the marker number, the step state text (Current/Completed/Not completed), and the label
  3. Verify with a screen reader (e.g., VoiceOver) that each step announces its state as part of the accessible name (e.g., "1 Current: Step 3")
  4. Run yarn jest --no-watchman packages/@adobe/react-spectrum/test/steplist/StepList.test.tsx

🧢 Your Project:

Open source accessibility contribution

Add the VisuallyHidden stepStateText element to the aria-labelledby
of each StepListItem link so screen readers announce the step state
(Current/Completed/Not completed) as part of the accessible name.

This ensures conformance with WCAG SC 2.5.3 Label in Name (Level A)
by including the visually hidden but rendered step state text in the
computed accessible name for each step.

Closes adobe#9881
@Krishnachaitanyakc Krishnachaitanyakc marked this pull request as ready for review April 7, 2026 21:03
@majornista majornista requested a review from Copilot April 10, 2026 16:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates StepListItem so the step state text (Current/Completed/Not completed), which is already rendered via VisuallyHidden, is now included in each step link’s accessible name to satisfy WCAG 2.5.3 “Label in Name”.

Changes:

  • Add a dedicated stateId and include it in the link’s aria-labelledby alongside the marker and label IDs.
  • Assign the stateId to the VisuallyHidden step state element so it can be referenced by aria-labelledby.
  • Add a unit test verifying aria-labelledby references marker/state/label elements and that the referenced state element contains the expected state text.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/@adobe/react-spectrum/src/steplist/StepListItem.tsx Includes step state text in the link’s accessible name by adding stateId to aria-labelledby and applying it to the visually hidden state element.
packages/@adobe/react-spectrum/test/steplist/StepList.test.tsx Adds coverage to confirm the new aria-labelledby structure and that the state text element is present and populated.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

StepListItem: stepStateText should be included as part of the accessible name for the item

3 participants