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
Open
fix(z-file-upload): add aria-labelledby to file input for WCAG 4.1.2#621ada-workbackai wants to merge 1 commit intomasterfrom
ada-workbackai wants to merge 1 commit intomasterfrom
Conversation
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.
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.
Summary
Fixes WCAG 4.1.2 (Name, Role, Value) by adding
aria-labelledbyattribute 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, andaria-labelledbyattributes. Screen reader users could not identify or interact with the file upload control.Solution: Added
aria-labelledbyattribute 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
aria-labelledby={this.description ? "description" : undefined}to input elementyarn buildyarn lintEvidence
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.