Skip to content

fix(a11y): connect question inputs to heading and description via aria#3228

Draft
pringelmann wants to merge 1 commit intomainfrom
fix/3172-aria-labelledby-question-inputs
Draft

fix(a11y): connect question inputs to heading and description via aria#3228
pringelmann wants to merge 1 commit intomainfrom
fix/3172-aria-labelledby-question-inputs

Conversation

@pringelmann
Copy link

@pringelmann pringelmann commented Mar 18, 2026

Summary

Screen readers couldn't associate question inputs with their title or description when tabbing through a form submission. This adds aria-labelledby and aria-describedby to all question type components, pointing to the title <h3> and description <div> for each question.

For Dropdown, File, and Color - where the input already has its own accessible name - the input is wrapped in div[role="group"] so the question title is announced at the group level without overriding the input's own label.

Also centralizes titleId/descriptionId in QuestionMixin.js (previously duplicated in QuestionMultiple and QuestionGrid).

TODO

  • All 8 question type components updated
  • Playwright e2e tests for aria attributes

Checklist

Add aria-labelledby and aria-describedby to all question type inputs,
connecting them to the question title and description so screen readers
announce them when a respondent focuses an input field.

Fixes #3172

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann force-pushed the fix/3172-aria-labelledby-question-inputs branch from 4a1057b to ddb741e Compare March 18, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[a11y] connect question heading, description with question input

1 participant