Skip to content

Conversation

@llastflowers
Copy link
Contributor

What are you trying to accomplish?

  • Address a11y remediation issue
  • Make SR announce the label associated with a multi-input in all cases

Integration

N/A

List the issues that this change affects.

Addresses https://github.com/github/accessibility-audits/issues/14774

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.
  • Medium risk changes that are isolated, reduced in scope or could impact few users. The change will not impact library availability.
  • High risk changes are those that could impact customers and SLOs, low or no test coverage, low observability, or slow to rollback.

What approach did you choose and why?

The label was not being announced when the initial selection was changed because the inputs did not have unique IDs. Now that they have unique ids, the label will always be announced regardless of selection state.

Anything you want to highlight for special attention from reviewers?

N/A

Accessibility

Fix for a11y audit remediation issue

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Lookbook)
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2026

🦋 Changeset detected

Latest commit: 7d2e5c8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Assign unique IDs to inputs for improved accessibility.
… github.com:primer/view_components into llastflowers/14774/region-label-sr-announcement-fix
… github.com:primer/view_components into llastflowers/14774/region-label-sr-announcement-fix
@llastflowers llastflowers marked this pull request as ready for review January 23, 2026 20:41
@llastflowers llastflowers requested a review from a team as a code owner January 23, 2026 20:41
Copy link
Contributor

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

This PR improves the accessibility of the MultiInput form control so that screen readers consistently announce its label, and wires that behavior into the axe/preview tooling and metadata.

Changes:

  • Ensure form labels have stable, unique id attributes derived from the input base_id, and wire multi-input children to reference those labels via aria-labelledby.
  • Update the MultiInput DSL to give each constituent input a unique id, associate it with the shared label, and keep hidden inputs disabled while still present in the DOM.
  • Extend accessibility configuration (axe skip rules and static preview/info architecture JSON) for the MultiInput visually-hidden-label scenario and add a changeset for @primer/view-components.

Reviewed changes

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

Show a summary per file
File Description
static/previews.json Updates the multi_input/visually_hide_label preview’s skip_rules.wont_fix to include the label-title-only rule so CI reflects the expected a11y exception.
static/info_arch.json Mirrors the preview configuration by adding label-title-only to wont_fix for the multi_input/visually_hide_label preview entry in the information architecture metadata.
lib/primer/accessibility.rb Adds a per-component wont_fix rule for Primer::Alpha::MultiInput’s visually_hide_label scenario and normalizes scenario_name (string vs symbol) before looking up scenario-specific axe rules.
app/lib/primer/forms/form_control.html.erb Ensures every label rendered by the forms FormControl wrapper has a deterministic id (label-<base_id>) while still respecting any explicitly provided id.
app/lib/primer/forms/dsl/multi_input.rb Adjusts decorate_options so each child input in a multi-input gets a unique id and an aria-labelledby pointing at the shared label, and keeps hidden inputs disabled to avoid server submission.
.changeset/hip-flies-pretend.md Records a patch release for @primer/view-components summarizing the new unique-ID behavior for multi-input labels.

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

@llastflowers llastflowers added this pull request to the merge queue Jan 26, 2026
Merged via the queue into main with commit 5c2982d Jan 26, 2026
38 checks passed
@llastflowers llastflowers deleted the llastflowers/14774/region-label-sr-announcement-fix branch January 26, 2026 21:54
@primer primer bot mentioned this pull request Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants