KarimMokhtar / react-drag-drop-files

Light and simple Reactjs drag and drop files library to use with very flexible options to change, so you put whatever the design you want for your drop-area. Users can drag and drop or even select the file anywhere in the window.
MIT License
245 stars 86 forks source link

Issue using FileUploader component in a modal need to be fixed #140

Open peppapig13132 opened 4 months ago

peppapig13132 commented 4 months ago

Thanks for this easy-to-use library.

Recently, I tried to use this component in file upload modal. You can see an issue here. When you close the modal, the component still keeps file data, and you will see it again after re-opening the modal.

What I want to see here is initial message - Upload or drop a file right here instead of Uploaded Successfully! Upload another?.

How can we get it?

setFile(null) can only initialize the selected file name message as No file uploaded yet.

image

FE-Purr commented 2 months ago

same issue

niranjan404 commented 1 month ago

You can null the uploaded file using cancel funciton:

ref: https://youtu.be/nCf7wb8a4YM?t=996