Yuvaleros/material-ui-dropzone

initialFiles do not change value of underlying input field

lukqw opened this issue · 0 comments

lukqw commented

Hi there I am currently working on a checkout process, which has two steps, between which users can switch back and forth.

On step 1 of the checkout process, the dropzone is empty and someone can add a file.

To make this input required, I added the following to my DropzoneArea:
inputProps={{name: "file", id: "file", required: true, "style": {display: "inline-block", opacity: 0}}}

Now if I click on the button to go to the next page, the form is validated.
If the file is set, it let's me pass and navigate to step 2 of the checkout process.
If the file is not set, it shows the typical error, that the input is missing.
image

If I go back from step 2 of the checkout process, I am setting the initalFiles of my DropzoneArea to the file from my storage.
This works and the file is loaded into my DropzoneArea again. (which I can tell by the thumbnail showing up again on the DropzoneArea)

Only problem is, if I want to go to the next page, it tells me that the input is missing just like in the above image. And I have to re-add the file again.

Do you know why that might be?

I think that it might have to do with the input field not getting the correct value when initialFiles is provided