reactivesearch icon indicating copy to clipboard operation
reactivesearch copied to clipboard

Ability to Clear Search Input in DataSearch outside of tapping the Clear X Button?

Open dres-cifuentes opened this issue 7 years ago • 1 comments

Issue Type: enhacement

Platform: Native

Description: I have a master filter reset button. I need this button to also clear the input text within DataSearch. It doesn't seem like there's a way to do so. Would appreciate any help or workarounds

Reactivesearch version: x.y.z 0.12.0

Browser: iOS

Anything else:

dres-cifuentes avatar May 09 '19 17:05 dres-cifuentes

Found a work around. Took a look at a similar issue, and the sandbox example, which uses Vue, can be found HERE

Essentially there's a defaultSelected prop. Use local state, set the defaultSelected value as an empty string, and use the onValueChange prop to pass the value to state. Create a function to set the local state item to an empty string when you want to reset the search.

dres-cifuentes avatar May 09 '19 19:05 dres-cifuentes