Skip to content

fix(z-file-upload): add aria-labelledby to file input for WCAG 4.1.2#621

Open
ada-workbackai wants to merge 1 commit intomasterfrom
workbackai/fix/wcag-4.1.2-file-upload-accessible-name
Open

fix(z-file-upload): add aria-labelledby to file input for WCAG 4.1.2#621
ada-workbackai wants to merge 1 commit intomasterfrom
workbackai/fix/wcag-4.1.2-file-upload-accessible-name

Conversation

@ada-workbackai
Copy link
Copy Markdown
Contributor

Summary

Fixes WCAG 4.1.2 (Name, Role, Value) by adding aria-labelledby attribute to the file upload input element in the z-file-upload component.

Issue: The file upload input had no accessible name - it lacked an associated label element, aria-label, and aria-labelledby attributes. Screen reader users could not identify or interact with the file upload control.

Solution: Added aria-labelledby attribute to the <input type="file"> element that references the existing description span (id="description") when a description prop is provided. This allows assistive technologies to announce the purpose of the file input using the descriptive text.

Test Plan

  • Added aria-labelledby={this.description ? "description" : undefined} to input element
  • Built component successfully with yarn build
  • Verified linting passes with yarn lint
  • Tested accessibility tree shows input now has accessible name
  • Confirmed screen readers can announce the input purpose

Evidence

View before/after screenshots and full audit details:
https://app.workback.ai/dashboard/issue/2971/


WCAG Reference:
4.1.2 Name, Role, Value - Level A

User Impact: Screen reader users can now understand what the file upload input is for and interact with it successfully.

Associates the file input with its description text to provide
an accessible name for screen reader users, fixing WCAG 4.1.2
(Name, Role, Value) Level A violation.
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