react-autosuggest icon indicating copy to clipboard operation
react-autosuggest copied to clipboard

Is there a way to clear the input value? I DO NOT mean clearing value on select.

Open sauspi opened this issue 6 years ago • 2 comments

So I know how to clear the input value on item select, but is there a way how to do it as a reaction for some "form clear" event?

sauspi avatar Mar 06 '19 14:03 sauspi

Hey @sauspi, assuming you are holding the value of the input in the state object, you should be able to simply clear the state from an event handler. There should be no need to interact with the react-autosuggest api to accomplish this. Here's a code pen that should demonstrate what you're wanting.

blakeyoder avatar Mar 13 '19 18:03 blakeyoder

Clearing the value in the state fixed it for me.

DemRossi avatar May 05 '21 16:05 DemRossi