Remove file
jbk75 opened this issue · comments
Hi,
how is it possible to remove file that has been dropped in the read-file-drop ?
Hi 👋 , I come with the same question, I'm using the field as part of a pseudo form and once I upload the file to S3 I want to be able to clear the input so the user is either able to proceed with the form or drop a new file on the component.
Hi @castrolem , can you explain? FileDrop does not render any input
, as you can see from the demo the UI is reset as soon as the user is done dragging over the target
Oh yeah, what I meant was that I was using the Component as part of a form-like behaviour component, but the value of the file was remaining on the Component even after it finished uploading.
So I hooked the callback of the upload event to clear the state of the Component once finished too, but it felt a bit tacky to do it that way, it would have been nicer if the component exposed a clear prop to clear the state.
@castrolem I'm still a little lost, what do you mean by the "value of the file"? FileDrop
keeps no internal state about the file. Do you have any example code to share? It sounds like you found a straightforward workaround, but if there's an API change that we can make to improve the usability of FileDrop, I'm interested! I just don't completely understand what the suggestion is/what it would be 😅