umhan35 / react-native-search-bar

The high-quality iOS native search bar for react native.
MIT License
861 stars 207 forks source link

onSearchButtonPress only triggered after text is typed in #184

Open reinvanimschoot opened 3 years ago

reinvanimschoot commented 3 years ago

Hi guys

This seems like a small issue but I still would love to bring some attention to it.

The onSearchButtonPress callback is only called when some text is actually typed in the searchbar. For consistency's sake, I would love it if, even if the input is empty, the callback would still be called.

In my case, the callback is a keyboard dismissal. To give an example, in Instagram, if you press the search button without any input, it also just dismisses the keyboard. So I'm hoping to get the same kind of consistency.

Thanks for the great component!