react-firebase-file-uploader icon indicating copy to clipboard operation
react-firebase-file-uploader copied to clipboard

Clear input value

Open agstover opened this issue 7 years ago • 3 comments

Looking for a way to clear the value of the wrapped input element. I'm accessing the instance of the uploader (as seen here), but can't figure out how to clear the input.

ref={instance => { this.fileUploader = instance; } }

The reason I want this is that want to delete the file reference in my state store. This works fine if the next image uploaded is a different image, but because the input is still holding the old image, when you try to upload the same image it doesn't do anything.

agstover avatar Nov 24 '18 18:11 agstover

Any solution?

antoniorrm avatar Apr 29 '19 20:04 antoniorrm

Looking for a way to do this too. Once the upload is successful, the input should reset and clear the filename. I haven't been able to find a way. Tried with useRef using reset() and clear() and nothing is working.

Maybe the uploader needs an input value prop? Then you could clear it easily on success.

joshuaiz avatar May 15 '19 02:05 joshuaiz

up up

antoniorrm avatar May 18 '19 19:05 antoniorrm