-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Name should not be required for properties in data-url format #824
Labels
Comments
Hi, yes, thanks for the report. I didn't realize we validate that the name field is present for |
jorgerobles
added a commit
to jorgerobles/react-jsonschema-form
that referenced
this issue
Jan 21, 2019
KeroVieux
added a commit
to KeroVieux/react-jsonschema-form
that referenced
this issue
Jan 25, 2019
* 'master' of github.com:KeroVieux/react-jsonschema-form: updated replace submit button paragraph tag with div (rjsf-team#766) Fixes rjsf-team#824 (rjsf-team#1147) Fix bug where matching anyOf branch is not selected correctly (rjsf-team#1129) Document a gotcha with `additionalProperties` (rjsf-team#1149) doc: add permalinks and fix internal hyperlinks in documentation doc: add doc build instructions, update PR/issue templates with doc links Add onBlur and onFocus events for radio and checkbox widgets (rjsf-team#1143) add ui:help tips (rjsf-team#1145) doc: fix browserstack logo size docs: remove docs from README and link to readthedocs rjsf-team#1138 doc: organize docs into separate files rjsf-team#1138 doc: add browserstack logo rjsf-team#990 Add test and update documentation for using anyOf inside array items (rjsf-team#1131) # Conflicts: # src/components/Form.js
LucianBuzzo
pushed a commit
that referenced
this issue
Feb 7, 2019
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Prerequisites
Description
[Thank you for this awesome library. I have been using it extensively. Our primary work for this library to build ui dynamically through custom widgets using materil-ui and some others. Recently I created a custom file upload widget using https://github.com/react-dropzone/react-dropzone As I was going through documentation it says file widget only supports data-url. So i got bit worried how i will get to know file name since data-url does not contain file name. So I decided to skip name entirely continued my work. After completing file upload widget when I tested it, it kept on giving me this error file is not of type data-uri. Here is how I was setting its value
handleOnDropAccepeted(file){
let uploadedFilesNames = [];
It boggled me for hours as I could not figure out why it is not working. Then upon looking into your code I saw you are also encoding file name there in base64 and if we did not encode file name in string it will complain saying string data is not valid data-uri. So please mention this in your documentation for custom file upload widget you also need to encode file name there as well. Here is how my code looks now
export const addNameToDataURI=(dataURL, name)=>{
return dataURL.replace(";base64",
;name=${name};base64
);}
handleOnDropAccepeted(file){
let uploadedFilesNames = [];
as you can see encoding name into file is basically function from your code source
]
Steps to Reproduce
Ideally, I'm providing a sample JSFiddle or a shared playground link demonstrating the issue.
Expected behavior
[What you expected to happen]
Actual behavior
[What actually happened]
Version
You can usually get this information in your
package.json
or in the file URL if you're using the unpkg one.The text was updated successfully, but these errors were encountered: