Open JoshingYou1 opened 2 weeks ago
Hey team! Please add your planning poker estimate with Zenhub @Andrew565 @ataker @harshil1793 @it-harrison @jamigibbs @micahchiang @powellkerry @rsmithadhoc
Hi @JoshingYou1. What is the FileField
component? This is not something that is currently in the VA design system. Can you link to it?
Hi @JoshingYou1. What is the
FileField
component? This is not something that is currently in the VA design system. Can you link to it?
Maybe component is the wrong word? Here's the link: https://github.com/department-of-veterans-affairs/vets-website/blob/main/src/platform/forms-system/src/js/fields/FileField.jsx
@JoshingYou1 - Teams do have the ability to pass custom validation functions to VaFileInputMultiple
through the use of the onVaMultipleChange
prop. Here are the docs which show an example of this.
@JoshingYou1 - Teams do have the ability to pass custom validation functions to
VaFileInputMultiple
through the use of theonVaMultipleChange
prop. Here are the docs which show an example of this.
Yes, I've read through the docs. Is there a straight-forward way to integrate what is in FileField
into the onVaMultipleChange
prop though?
The prop accepts a callback and exposes an event that contains file information. What you could probably do is either use these file validators directly in whatever call back you pass in, or adapt them to your specific needs and then pass them in.
FileField is pretty tightly coupled to react-json-schema, so integrating what's in that file directly probably won't work. The validators I linked to are more agnostic.
If you're looking to use multiple file input in a form that uses react-json-schema, the forms team does provide a va file input field with the necessary bindings, though I'm not sure if adapting va file input multiple is on their roadmap.
Bug Report
What happened
What I expected to happen
Reproducing
Steps to reproduce:
VaFileInputMultiple
component.accept=".pdf, .doc, .docx, .jpg, .jpeg, .rtf, .png"
.gif
file to.doc
and upload it. It should let allow you to upload it with no validation errors, which is not the desired outcome.Urgency
How urgent is this request? Please select the appropriate option below and/or provide details
Details
FileField
BehaviorVaFileInputMultiple
Behavior