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
feat(field, file-input): enhance accessibility and add new props - #1785
FileInput and FileInputField had no ARIA wiring: help/validation text wasn't linked to the input, and the screen reader heard nothing when files were added or removed.
What changed:
Button name/description: label, help text and validation text get ids (from name); the upload button gets aria-labelledby (button text + field label) and aria-describedby (help + validation text).
Live announcements: FileInputField renders a hidden role="status" region via a new statusMessage prop.
Remove button: gets role="button" and aria-label="Remove <filename>" (reuses existing removeText);
Known issues
Removing a file from FileInputFieldWithList unmounts its "Remove" control, so keyboard focus is lost to <body> (Follow-up: LIBS-873)
SonarCloud S6819 on file-input-field.js ("use <output> instead of role="status""): false positive.
I'm keeping <span role="status"> for the hidden live region. role="status" is the usual way to announce updates, and screen readers handle it more reliably than <output>. <output> is also a form element, so it would end up in form.elements, which we don't want for something that only exists for assistive tech. AlertBar already uses the same pattern.
SonarCloud S6819 on file-list-item.js ("use <button> instead of role="button""): valid, but intentionally deferred.
The Remove action is still a <span> with role="button", tabIndex={0}, an aria-label and Enter/Space/Delete handling, so it's usable with keyboard and screen readers. Switching to a native <button> would change the markup and default styling for people using the component, and it needs a rewrite of the key handling to avoid calling onRemove twice.
But if you think it's worth switching to a native <button>, let me know.
netlify—b46ab05b
Deployed
Oct 27, 2026 by
dhis2-bot
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
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.
Implements LIBS-857
Description
FileInputandFileInputFieldhad no ARIA wiring: help/validation text wasn't linked to the input, and the screen reader heard nothing when files were added or removed.What changed:
name); the upload button getsaria-labelledby(button text + field label) andaria-describedby(help + validation text).FileInputFieldrenders a hiddenrole="status"region via a newstatusMessageprop.role="button"andaria-label="Remove <filename>"(reuses existingremoveText);Known issues
FileInputFieldWithListunmounts its "Remove" control, so keyboard focus is lost to<body>(Follow-up: LIBS-873)Checklist