Erasing File Input value on click
See original GitHub issueHello,
First, thanks for the really great project. This has made our lives alot easier.
We use redux/redux-form 5.3.3 to manage our state. So we represent the files as a field object, those fields are tied to inputs. If the value of that input changes it dispatches a redux event of redux-form/CHANGE
for the field that was associated with that input.
What that means for this libraries interaction, is that when someone clicks on a dropzone, it sets the value to null, which erases the value from our store. We have gotten around this by storing the original value in the components state and using that when needed.
My question is, would it be possible or wanted to remove the erasing the file when dropzone is clicked? What are your thoughts?
If acceptable I would be able to write the code and tests for it.
I can also think of several alternatives to removing including
- store the originalValue and on cancel, set the input value to the originalValue
- Create an option to react-dropzone that would allow bypassing the always clear function
open() {
this.fileInputEl.value = null; //this is the line i mean
this.fileInputEl.click();
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:9
@okonet i like that, looks like we are all busy but if i get a couple hour opening at night will whip up a PR for this.
This issue has been automatically marked as stale because it has not had recent activity in the past 60 days. It will be closed if no further activity occurs. If the problem persists please comment here to bump your issue. Thank You - React Dropzone Maintaners