react-native-google-places-autocomplete 2.5.3 → 2.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -84,10 +84,15 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
|
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
const buildRowsFromResults = (results) => {
|
|
87
|
+
const buildRowsFromResults = (results, text) => {
|
|
88
88
|
let res = [];
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
const shouldDisplayPredefinedPlaces = text
|
|
90
|
+
? results.length === 0 && text.length === 0
|
|
91
|
+
: results.length === 0;
|
|
92
|
+
if (
|
|
93
|
+
shouldDisplayPredefinedPlaces ||
|
|
94
|
+
props.predefinedPlacesAlwaysVisible === true
|
|
95
|
+
) {
|
|
91
96
|
res = [
|
|
92
97
|
...props.predefinedPlaces.filter((place) => place?.description.length),
|
|
93
98
|
];
|
|
@@ -511,7 +516,7 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
|
|
|
511
516
|
: responseJSON.predictions;
|
|
512
517
|
|
|
513
518
|
_results = results;
|
|
514
|
-
setDataSource(buildRowsFromResults(results));
|
|
519
|
+
setDataSource(buildRowsFromResults(results, text));
|
|
515
520
|
// }
|
|
516
521
|
}
|
|
517
522
|
if (typeof responseJSON.error_message !== 'undefined') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-google-places-autocomplete",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"description": "Customizable Google Places autocomplete component for iOS and Android React-Native apps",
|
|
5
5
|
"main": "GooglePlacesAutocomplete.js",
|
|
6
6
|
"types": "GooglePlacesAutocomplete.d.ts",
|