Repository navigation
fix(a11y): give the file upload button an accessible name - #3902
Merged
Chartman123 merged 2 commits intoNov 18, 2026
Merged
Conversation
Chartman123
requested changes
Nov 16, 2026
Collaborator
|
@v01dst Thanks for your contribution. Please also add the AI block back to the PR description if you used AI for this. DCO also doesn't pass as you didn't sign-off your commit |
v01dst
force-pushed
the
fix/3839-file-upload-button-name
branch
from
November 16, 2026 16:21
86c1d2f to
428c38c
Compare
The upload button of a file question only holds an icon, so a screen reader announces it as "button" without saying what it does. axe reports it as `button-name`, which fails WCAG 4.1.2. The button now gets an `aria-label`. It says "Upload a file" for a question that takes one file and "Upload files" when more than one file is allowed. The visible text "Add new file as answer" stays where it is: it belongs to the label of the hidden file input, not to the button. Fixes nextcloud#3839 Signed-off-by: v01dst <v01dst@users.noreply.github.com> Assisted-by: OpenCode:MiniMax-M3.1-Flash
v01dst
force-pushed
the
fix/3839-file-upload-button-name
branch
from
November 17, 2026 15:33
428c38c to
3523117
Compare
Contributor
Author
|
Thanks for the hint. The commit is signed off now, and the AI block is back in the description. The commit also carries an If anything else is missing, please tell me. |
Collaborator
The requested changes in QuestionFile.vue regarding the translations are still pending :) |
AndyScherzinger
marked this pull request as draft
November 18, 2026 14:40
The name of the upload button now comes from n(), so each language gets the plural forms it needs for the number of files a question allows. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Chartman123
marked this pull request as ready for review
November 18, 2026 15:21
Chartman123
self-requested a review
November 18, 2026 15:22
Chartman123
approved these changes
Nov 18, 2026
Collaborator
|
/backport to stable5.4 |
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
The upload button of a file question carries only an icon (
IconUpload/IconUploadMultiple). A screen reader announces it as "button" and nothingtells the user what it does, which fails WCAG 4.1.2 Name, Role, Value. axe
reports it as
button-name(critical).The visible text "Add new file as answer" is not a fix here: it belongs to the
<label>around the hidden<input type="file">, so it never reaches thebutton.
In the editor the button is disabled as well, so it shows up there as an
unnamed, disabled button.
Solution
The button gets an
aria-label:The label follows
maxAllowedFilesCount, the same setting that picks theicon, so the two never disagree.
Test
playwright/e2e/a11y-question-inputs.spec.tsgains a case that opens a formwith a file question, switches to the view mode and looks for the button by
its accessible name:
Looking the button up by role and name is the same check a screen reader
does, so the test fails without the fix.
Testing
npx prettier --checkon both changed files: passesnpx eslinton both changed files: passesnpm run typecheck: no new errors. The project has 113 type errors onmainalready (QuestionDate.vue,QuestionMultiple.vue,QuestionRanking.vueand others); the count and the file list areunchanged with this branch applied.
The Playwright suite needs a running Nextcloud server, so it could not be
executed here.
Fixes #3839
🤖 AI (if applicable)
An AI coding agent (OpenCode, MiniMax-M3.1-Flash) drafted the component
change and the Playwright case. I read the diff line by line, ran prettier,
eslint and the type check, and wrote the text above myself.