react-native-google-places-autocomplete
react-native-google-places-autocomplete copied to clipboard
Add boolean prop to control if we render or not results FlatList when there are no results
Is your feature request related to a problem? Please describe.
I need to make the results list completely disappear when there are no results.
We are applying rounded borders to the results list using styles.listView
, but when there are no results to display, we can still see the grey line because of the borders of the empty list being rendered.
Describe the solution you'd like
Add a prop like hideEmptyListView
(default false
) or renderEmptyListView
(default true
) that would give us control over rendering or not the empty list.
This could be implemented by Including a new condition in this if
that checks the new prop and the number of results:
https://github.com/FaridSafi/react-native-google-places-autocomplete/blob/47d7223dd48f85da97e80a0729a985bbbcee353f/GooglePlacesAutocomplete.js#L751-L757
Describe alternatives you've considered
Try to move the rounded borders to the stying of each row. Couldn't make it work. It is not possible to know if it is the last element of the list, and it requires a lot of work.
Additional context
Add any other context or screenshots about the feature request here.