react-file-input icon indicating copy to clipboard operation
react-file-input copied to clipboard

Clear selected value

Open vasromand opened this issue 8 years ago • 2 comments

Hi there! How can I clear seleted value? I'm tried to set value={this.state.image} and then to set it to null, but it doesnt work.

vasromand avatar Jan 26 '17 03:01 vasromand

You can do this explicitly like this without React:

document.getElementsByName("myImage")[0].value = ""

ronaksvyas avatar Mar 09 '17 10:03 ronaksvyas

it's better to do

uploadHandler(event) {
   if (error)  event.target.value = '';
}

I guess.

zirho avatar Apr 19 '17 22:04 zirho