Repository navigation
fix(core): link Collapsible trigger to its content via aria-controls - #3707
Merged
Merged
Conversation
bhamodi
requested review from
cixzhang,
ejhammond,
imdreamrunner,
josephfarina,
marie-lucas,
nynexman4464 and
thedjpetersen
as code owners
July 9, 2026 03:23
|
@bhamodi is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
The Collapsible trigger set `aria-expanded` but had no `aria-controls`, and its content region had no `id`, so the disclosure relationship was implicit only. Add a `useId()`-generated `id` on the content region and `aria-controls` on the trigger button. Test plan: - pnpm -F @astryxdesign/core exec vitest run src/Collapsible/CollapsibleGroup.test.tsx (33 pass, incl. new "links the trigger to its content region via aria-controls") - core typecheck + eslint on changed files: clean
bhamodi
force-pushed
the
a11y/collapsible-aria-controls
branch
from
July 9, 2026 03:23
e10b5c5 to
717b868
Compare
This was referenced Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Collapsible's trigger exposedaria-expandedbut had noaria-controls, and its content region had noid— so the disclosure relationship (button ↔ the region it shows/hides) was implicit only. Assistive tech couldn't move from the trigger to its controlled content.This adds a
useId()-generatedidon the content region and wiresaria-controlsto it on the trigger button. Purely additive; no behavior/visual change. This matches the pattern already used byMetadataListandSideNav.Changes
Collapsible/Collapsible.tsx:useId()→idon content region +aria-controlson the trigger button; updated the file header doc.Test plan
pnpm -F @astryxdesign/core exec vitest run src/Collapsible/CollapsibleGroup.test.tsx— 33 pass, including a new test:links the trigger to its content region via aria-controls— asserts the trigger'saria-controlsis set, resolves to a real element viadocument.getElementById, and that element contains the collapsible content.tsc --project packages/core/tsconfig.json --noEmit— clean.eslinton changed files — clean.Notes
Found during a broader a11y audit of core components. Scoped to one fix per PR.