Skip to content
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

inputProps not working when setting files prop to an array of files #167

Closed
OmarZidan1997 opened this issue May 13, 2020 · 1 comment · Fixed by #175
Closed

inputProps not working when setting files prop to an array of files #167

OmarZidan1997 opened this issue May 13, 2020 · 1 comment · Fixed by #175
Labels
Milestone

Comments

@OmarZidan1997
Copy link

ISSUE

I have with inputProps on DropzoneArea. I checked the documentation of how i can use it and i followed as specified but it does still not work. Im trying to upload image and it shows on the preview section but Im using stepper form which means when i procceed to the next step and go back to the previous, my uploaded image on the preview section is gone.

below is my code

          <DropzoneArea
          dropzoneClass={classes.uploadImageDropZone}
            open={openImageDialog}
            acceptedFiles={["image/*"]}
            showPreviews={true}
            showPreviewsInDropzone={false}
            cancelButtonText={"cancel"}
            submitButtonText={"submit"}
            filesLimit={1}
            // initialFiles={[]}
            onChange={handleImage}
            onClose={(e) => {
              setOpenImageDialog(false);
            }}

            inputProps={{
              files: values.imageFile
            }}
          />

values.imageFile is an array of File objects.

any suggestion of how i can solve this problem?

@panz3r
Copy link
Contributor

panz3r commented May 15, 2020

Hi @OmarZidan1997 ,

Thanks for your feedback, unfortunately at the moment what you're trying to achieve is not possibile, you can however try using the initialFiles props but that behaves a little bit differently.

See issue #75 for more details on how we'll try to tackle this kind of issues.

@panz3r panz3r added this to the 3.2 milestone May 15, 2020
@panz3r panz3r mentioned this issue May 27, 2020
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants