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

FileInput onChange event that handles both file addition and removal #3103

Closed
UltimateForm opened this issue Apr 5, 2019 · 2 comments
Closed

Comments

@UltimateForm
Copy link
Contributor

UltimateForm commented Apr 5, 2019

Is your feature request related to a problem? Please describe.
My poblem is that it is kind of clunky to manage files under FileInput. Currently there is the onDrop prop passed through options prop, which I can't use because it blocks FileInput's onDrop listeners, I could use onChange (also passed through options) but this one only triggers when files are added through click and file explorer, when file is dropped it does not trigger. I can find ways to work around this with blocking the onDrop functions but setting the form manually through redux-form's change but I prefer a more natural reactadmin-like approach. Also, I'm using the FileInput as ImageInput with the multiple files

Describe the solution you'd like
I'd like an implementation that allowed me to know when a file was removed or added and I've noticed that FileInput.js has the onRemove and onDrop functions which it could use to call this new better (imo) onChange event

@tunglt1810
Copy link

I think solution for you in some article like this
https://medium.com/@650egor/simple-drag-and-drop-file-upload-in-react-2cb409d88929

@WiXSL
Copy link
Contributor

WiXSL commented Feb 4, 2022

This has been implemented long ago in #4140 and #4637. Plus the addition of #7003 in next should do it.
So I'm closing this issue.

@WiXSL WiXSL closed this as completed Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants