fix(a11y): connect question inputs to heading and description via aria#3228
Draft
pringelmann wants to merge 1 commit intomainfrom
Draft
fix(a11y): connect question inputs to heading and description via aria#3228pringelmann wants to merge 1 commit intomainfrom
pringelmann wants to merge 1 commit intomainfrom
Conversation
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>
4a1057b to
ddb741e
Compare
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
Screen readers couldn't associate question inputs with their title or description when tabbing through a form submission. This adds
aria-labelledbyandaria-describedbyto 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/descriptionIdin QuestionMixin.js (previously duplicated in QuestionMultiple and QuestionGrid).TODO
Checklist
3. to review, feature component)stable32)