Repository navigation
fix(a11y): screen reader fixes for the linear scale question - #3989
Merged
Merged
Conversation
A required linear scale left empty shows "You must answer this question" and marks its radio buttons invalid. Picking a value did not clear either until the next submit attempt, so screen readers went on announcing the picked value as invalid. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
In the editor the radio buttons of a linear scale referenced the question title as their group name and the label of the lowest value as the description of the first one, but both are only rendered on the submit page, so the references pointed nowhere. On the submit page the description of the first radio button pointed nowhere as well when the label of the lowest value is empty. Both are now set only where the element exists. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
The first option of a linear scale is described by the label of the lowest value, but nothing referenced the label of the highest value: the hidden legend that names both is overridden by the question title. Screen reader users moving through the options heard what the lowest value means, but never what the highest one means, which on a 0 to 10 scale is what tells them the direction. The last option is now described by the label of the highest value where it is shown. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
The hidden legend of a linear scale names its lowest and highest label. The translation function escaped them for HTML, but the legend is plain text, so a label with an apostrophe or an ampersand reached screen readers as "Don't agree" or "&". The legend now takes the labels as written, like the other texts that hold user input. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
The radio buttons of a linear scale have no label text of their own, so the component gave them an aria-labelledby pointing to a label that is never rendered. Browsers fell back to the number next to each button, but the reference itself was broken. The options are now named by their value directly. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 task done
Member
Author
|
/backport to stable5.4 |
Chartman123
approved these changes
Nov 22, 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.
Problem
Screen reader issues of the linear scale question:
aria-invalidafter a value was picked, until the next submit attempt.aria-labelledbypointing to a label the component never renders (axe:aria-valid-attr-value).Change
QuestionLinearScale.vue: picking a value clears the error; the title, description and label references are set only where those elements exist; the last option is described by the highest label; the legend uses the labels as written (escape: false, sanitize: false); the options are named by their value througharia-label, which drops the broken reference.How to verify
aria-labelledbyoraria-describedbyon the group or the radios pointing to missing ids.aria-invaliddisappear.Playwright tests in
a11y-question-inputs.spec.tsandrequired-fields.spec.tscover each point.🤖 AI (if applicable)