react-autosuggest
react-autosuggest copied to clipboard
Is there a way to clear the input value? I DO NOT mean clearing value on select.
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?
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.
Clearing the value in the state fixed it for me.