Skip to content

FIX give each multiselect checkbox its own accessible name - #2432

Open
tejas_0007 (tejas0077) wants to merge 3 commits into
microsoft:mainfrom
tejas0077:fix/multiselect-checkbox-accessible-names
Open

FIX give each multiselect checkbox its own accessible name#2432
tejas_0007 (tejas0077) wants to merge 3 commits into
microsoft:mainfrom
tejas0077:fix/multiselect-checkbox-accessible-names

Conversation

@tejas0077

Copy link
Copy Markdown
Contributor

Fixes #2419

Each checkbox in a multiselect Field was receiving aria-labelledby pointing to the surrounding Field label (e.g. "tags"), overriding the individual visible option label. Screen readers announced every checkbox as "tags, checkbox" instead of "default, checkbox", "core, checkbox" etc.

Fix: added aria-label={choice} to each Checkbox so the individual option label is used as the accessible name. Also moved the group label to a visually-hidden span referenced by aria-labelledby on the group div, preserving "tags" as the group label for screen readers.

Added srOnly utility style to AdditionalInitializers.styles.ts for the visually-hidden span.

Verified the fix by inspecting the rendered accessibility tree. The existing test suite covers checkbox rendering and interaction. No documentation changes needed for this frontend accessibility fix.

Each checkbox in a multiselect Field was receiving aria-labelledby
pointing to the surrounding Field label (e.g. 'tags'), overriding the
individual visible option label. Screen readers announced every checkbox
as 'tags, checkbox' instead of 'default, checkbox', 'core, checkbox' etc.

Fix: add aria-label={choice} to each Checkbox so the individual option
label is used as the accessible name. Also move the group label to a
visually-hidden span referenced by aria-labelledby on the group div,
preserving 'tags' as the group label for screen readers.

Added srOnly utility style to AdditionalInitializers.styles.ts.

Fixes microsoft#2419
@hannahwestra25 hannahwestra25 self-assigned this Aug 20, 2026
<Checkbox
key={choice}
id={`param-${parameter.name}-${choice}`}
aria-label={choice}

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.

Fluent’s Field still injects aria-labelledby, which takes precedence over aria-label, so these may still be announced as “tags.” We could explicitly connect each checkbox to its own label:

const choiceLabelId = `param-${parameter.name}-${choice}-label`

<Checkbox
  label={{ children: choice, id: choiceLabelId }}
  aria-labelledby={choiceLabelId}
/>

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.

Initializer multiselect checkboxes expose identical accessible names

3 participants