You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File question: the upload button has no accessible name #3839
Describe the bug
The upload button of a file question has no accessible name. Screen readers announce it as "button", and nothing tells the user what it does (WCAG 4.1.2 Name, Role, Value). axe reports it as button-name (critical).
In src/components/Questions/QuestionFile.vue the NcButton next to the hidden file input only has an icon (IconUpload / IconUploadMultiple) and no aria-label. The visible text "Add new file as answer" belongs to the <label> around the hidden <input type="file">, not to the button.
In the editor the button is also disabled (:disabled="!readOnly || …"), so it shows up there as an unnamed, disabled button.
To Reproduce
Create a form with a file question.
Open the form to answer it (/apps/forms/<hash>/submit).
Inspect the upload button with the browser's accessibility tree, or run axe on the page.
The button has no name.
Expected behavior
The button has a name, for example :aria-label="t('forms', 'Upload a file')", or 'Upload files' when several files are allowed. Alternatively, the button is hidden from assistive technology when the labelled file input is the real control.
Nextcloud (please complete the following information):
Nextcloud-Version: master
Forms-Version: main (5.5.0-dev)
Additional context
Found while reviewing #3123 (conditional questions). It is not caused by that PR: a top-level file question on main has the same problem.
Activity