react-native-searchbar icon indicating copy to clipboard operation
react-native-searchbar copied to clipboard

added "setResults()" function to show results below the search bar

Open alikazemkhanloo opened this issue 7 years ago • 2 comments

Hi I wanted to show the search results on top of everything in my app, I thought it is a good idea to add a function to the SearchBar to show the results.

So here it is. usage:

const results = <View> <Text> This is a test </Text></View>
this.searchBar.setResults(results)

I wanted to send the results as an array instead of whole component, But that was OK for me. You can do it yourself, If you want to.

Best wishes, and thank you for this great library

alikazemkhanloo avatar Jul 02 '18 06:07 alikazemkhanloo

for a scrollable results, you should set the resultsHeight in props

alikazemkhanloo avatar Jul 02 '18 13:07 alikazemkhanloo

It is good for my app, I have to focus on my job for now. You got the idea, If you want you can enhance this PR.

Thank you.

alikazemkhanloo avatar Jul 04 '18 08:07 alikazemkhanloo