Skip to content

fix(a11y): screen reader fixes for the linear scale question - #3989

Merged
Chartman123 merged 5 commits into
mainfrom
fix/a11y-linear-scale
Nov 22, 2026
Merged

Chartman123 merged 5 commits into
mainfrom
fix/a11y-linear-scale

Conversation

@AndyScherzinger

Copy link
Copy Markdown
Member

Problem

Screen reader issues of the linear scale question:

  • A required scale kept "You must answer this question" and aria-invalid after a value was picked, until the next submit attempt.
  • In the editor, the radio buttons referenced the question title and the lowest label by id, but those are only rendered on the submit page; on the submit page the first option also pointed to the lowest label when it is empty.
  • Only the first option was described by its label. The label of the highest value was never announced, although on a 0 to 10 scale it is what tells the direction.
  • The hidden legend escaped the labels for HTML, so "Don't agree & leave" was read as "Don't agree & leave".
  • Every radio button carried an aria-labelledby pointing 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 through aria-label, which drops the broken reference.

How to verify

  1. Add a linear scale with a description and labels such as "Don't agree & leave" / "Strongly agree", mark it required.
  2. Editor: no aria-labelledby or aria-describedby on the group or the radios pointing to missing ids.
  3. Submit page: the first option is described by the lowest label, the last by the highest label, the legend reads the labels as written, each radio is named by its value; submit empty, then pick a value: the error and aria-invalid disappear.

Playwright tests in a11y-question-inputs.spec.ts and required-fields.spec.ts cover each point.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

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&#39;t agree" or "&amp;". 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>
@AndyScherzinger AndyScherzinger added this to the 5.5 milestone Nov 22, 2026
@AndyScherzinger AndyScherzinger added bug Something isn't working 3. to review Waiting for reviews feature: ❓ question types a11y related to accessibility AI assisted labels Nov 22, 2026
@AndyScherzinger

Copy link
Copy Markdown
Member Author

/backport to stable5.4

@AndyScherzinger AndyScherzinger added the backport-request Pending backport by the backport-bot label Nov 22, 2026
@Chartman123
Chartman123 merged commit a7c18ab into main Nov 22, 2026
43 checks passed
@Chartman123
Chartman123 deleted the fix/a11y-linear-scale branch November 22, 2026 22:31
@backportbot backportbot Bot removed the backport-request Pending backport by the backport-bot label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews a11y related to accessibility AI assisted bug Something isn't working feature: ❓ question types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants