-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[FileUploader]: missing/inconsistent file validation #21166
Copy link
Copy link
Open
Labels
component: file-uploaderpackage: @carbon/react@carbon/react@carbon/reactproposal: openThis request has gone through triaging. We're determining whether we take this on or not.This request has gone through triaging. We're determining whether we take this on or not.role: dev 🤖status: needs design spectype: enhancement 💡
Metadata
Metadata
Assignees
Labels
component: file-uploaderpackage: @carbon/react@carbon/react@carbon/reactproposal: openThis request has gone through triaging. We're determining whether we take this on or not.This request has gone through triaging. We're determining whether we take this on or not.role: dev 🤖status: needs design spectype: enhancement 💡
Type
Fields
Give feedbackNo fields configured for Enhancement.
Projects
StatusShow more project fields
🪆 Needs Refined
StatusShow more project fields
Later 🧊
The problem
The
FileUploadercomponents have inconsistent and sometimes duplication validation.The solution
File validation should be made consistent for all uploader components which require it. Since there are at least two already identified, it makes sense to extract all validation logic into a shared utility.
Examples
The default FileUploader story states that only
jpgfile types are allowed, but this is UI-level filtering only. Users can bypass by selecting 'all files' in the file dialog. There is no JS validation for file types.The drag and drop story correctly displays a validation error when invalid file types are added.
Design impact
Yes, visual design
Documentation impact
Package
@carbon/react
Application/PAL
Carbon Design System
Business priority
Low Priority = release date is not dependent on fix or not upcoming
Available extra resources
No response
Code of Conduct