react-jsonschema-form: [bootstrap-4] File uploads result in error ".file should match format "data-url""
Prerequisites
- I have read the documentation;
- In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
- Ideally, I’m providing a sample JSFiddle or a shared playground link demonstrating the issue.
Description
Using the bootstrap-4
theme, submitting a file triggers an error:
.file should match format "data-url"
Steps to Reproduce
- Playground link
- Click “Choose file” for the first file upload
- Select any file from your computer
- Click “Submit”
Expected behavior
No errors are displayed.
Actual behavior
The following error is displayed:
.file should match format "data-url"
Version
master
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 15 (6 by maintainers)
Commits related to this issue
- fix: Fixed FileWidget to work across all themes Fixes #2095 by making `FileWidget` use the `BaseInputTemplate` for rendering the file input - Updated `@rjsf/utils` to fix two small bugs found while fi... — committed to heath-freenome/react-jsonschema-form by heath-freenome a year ago
- fix: Fixed FileWidget to work across all themes Fixes #2095 by making `FileWidget` use the `BaseInputTemplate` for rendering the file input - Updated `@rjsf/utils` to fix two small bugs found while fi... — committed to heath-freenome/react-jsonschema-form by heath-freenome a year ago
- fix: Fixed FileWidget to work across all themes Fixes #2095 by making `FileWidget` use the `BaseInputTemplate` for rendering the file input - Updated `@rjsf/utils` to fix two small bugs found while fi... — committed to heath-freenome/react-jsonschema-form by heath-freenome a year ago
- fix: Fixed FileWidget to work across all themes Fixes #2095 by making `FileWidget` use the `BaseInputTemplate` for rendering the file input - Updated `@rjsf/utils` to fix two small bugs found while fi... — committed to heath-freenome/react-jsonschema-form by heath-freenome a year ago
@Hasenn I worked around it using this:
I first created a widget in my repo called BootstrapFileWidget and reference the FileWidget from core:
Then i popped that into the widgets
Then, made sure my file was using that widget:
Not the cleanest workaround, but it got me up in running in a few minutes
Also see https://github.com/rjsf-team/react-jsonschema-form/issues/2418 for more context
@tjuravich / @CKGrafico would you like to make a PR that fixes the bootstrap 4 file widget? 🙏
Super small update to @tjuravich great solution 😃
To have label like in bootstrap theme