Skip to content

a11y: restore aria-label on <select> (html10n cannot auto-populate)#137

Merged
JohnMcLear merged 1 commit intomainfrom
a11y/restore-select-aria-label
May 10, 2026
Merged

a11y: restore aria-label on <select> (html10n cannot auto-populate)#137
JohnMcLear merged 1 commit intomainfrom
a11y/restore-select-aria-label

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

Reverts the aria-label removal on the <select> element introduced by the previous Phase 3a sweep (#136).

Why this needed reverting: etherpad's html10n only auto-populates aria-label for elements with no children (or when the data-l10n-id has an attribute suffix like .title). <select> elements always have <option> children, so the fallback at html10n.ts:665-678 is bypassed. After the previous PR, the <select> was left with no accessible name at all.

This is a stopgap — the hardcoded English aria-label is back, which is bad for translated UI but better than no accessible name. The proper fix is a small change to html10n.ts to populate aria-label on form-controllable elements (<select>, <input>, <textarea>) regardless of children. That should be a follow-up PR against ether/etherpad.

The earlier PR removed aria-label from this <select> assuming etherpad's
html10n would auto-populate it from data-l10n-id. It does not — the
auto-population path at html10n.ts:665-678 only fires when an element
has no children (or when the data-l10n-id ends in a recognized
attribute suffix). <select> elements always have <option> children, so
the fallback is bypassed and the element loses its accessible name.

Restoring the hardcoded aria-label as a stopgap. The proper fix is to
extend html10n to populate aria-label for form-controllable elements.
@qodo-code-review
Copy link
Copy Markdown

ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@JohnMcLear JohnMcLear merged commit bf9cf07 into main May 10, 2026
3 checks passed
@JohnMcLear JohnMcLear deleted the a11y/restore-select-aria-label branch May 10, 2026 08:07
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.

1 participant