-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.2.1 has broken file uploads (schema attached) #3504
Comments
@billycrid so I just put your example into the playground and could not reproduce the issue. Do you have any customizations? |
@heath-freenome please see the defect recreated in a codesandbox URL: https://codesandbox.io/embed/condescending-raman-fylt3x?fontsize=14&hidenavigation=1&theme=dark hopefully this helps to recreate. Also note, if you change the version down to 5.2.0 this upload file works as expected. |
@billycrid What specifically isn't working? I managed to upload a csv file just fine using your code sandbox. There was an issue with submitting complaining about missing required field, but adding the |
@heath-freenome yeah this is exactly the issue, because the field is validating as not being complete, we are getting the HTML5 error suddenly which is blocking form submission even though all required fields are actually populated. Disabling Html5 Validation should not be an acceptable 'fix' for this as we still require HTML5 validation on all fields in the form. Is there anything else we can do to get around this or any fix thats possible to keep HTML5 validation but form field actually be filled out? |
Fixes rjsf-team#3504 by setting the `required` prop to false once a file is chosen Also enhanced the `ObjectFieldTemplate` to be able to receive the `errorSchema` - In `@rjsf/utils`, added `errorSchema` to the `ObjectFieldTemplateProps` - In `@rjsf/core`, updated `ObjectField` to pass the `errorSchema` to the `ObjectFieldTemplate` - Also updated `FileWidget` to pass false as the `required` prop once a file has been chosen
…3547) Fixes #3504 by setting the `required` prop to false once a file is chosen Also enhanced the `ObjectFieldTemplate` to be able to receive the `errorSchema` - In `@rjsf/utils`, added `errorSchema` to the `ObjectFieldTemplateProps` - In `@rjsf/core`, updated `ObjectField` to pass the `errorSchema` to the `ObjectFieldTemplate` - Also updated `FileWidget` to pass false as the `required` prop once a file has been chosen
Prerequisites
What theme are you using?
core
Version
5.2.1
Current Behavior
Currently with 5.2.1, when trying to upload a file with default bootstrap configuration: after attaching a .csv file (with uiSchema specifying only .csv format allowed). after clicking Submit the field is highlighted with 'field is required'
Expected Behavior
File should be attached to the form as previously was in 5.2.0
Steps To Reproduce
can be recreated in this codesandbox: https://codesandbox.io/embed/condescending-raman-fylt3x?fontsize=14&hidenavigation=1&theme=dark
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: