I am saving recently searched terms in my state and when user clicks on one of the recent searches, I do
this.autoCompleteRef.setAddressText(this.state.recentSearch). This updates the text input value but the search is not triggered. I have to press one more key to see the search results from place autocomplete api
Steps to reproduce the behavior - a minimal reproducible code example, link to a snack or a repository.
Please provide a FULLY REPRODUCIBLE example.
Click to expand!
```js
placeholder="Search"
styles={{textInput: {borderBottomColor: "#4a4a4a", borderBottomWidth: 1, backgroundColor: 'transparent'}}}
onPress={(data, details = null) => {
// 'details' is provided when fetchDetails = true
console.log(data);
console.log(details);
}}
query={{
key: 'key',
language: 'en',
components: 'country:in',
}}
currentLocation={true}
currentLocationLabel="Use your current location"
nearbyPlacesAPI="GoogleReverseGeocoding"
textInputProps={{onBlur: () => {}}}
fetchDetails //details.geometry.location - gives lat, lng
/>
handleRecentLocationClick = (desc) => {
this.autoCompleteRef.setAddressText(desc)
this.autoCompleteRef.focus()
}
```
_Please remember to remove you google API key from the code you provide here_
React Native Version: [e.g. 0.62.2]
[ ] iOS
If you are using expo please indicate here:
Add any other context about the problem here, screenshots etc
You need this.autoCompleteRef.triggerFocus() before version 2.
https://github.com/FaridSafi/react-native-google-places-autocomplete/releases/tag/v2.0.0
Hello @bell-steven i am on version 2.0.3
"react-native-google-places-autocomplete": "^2.0.3"
Ok. Can you try using version 2.1.1. There were some changes in v2.1.0 that may have addressed the issue.
Ok. Can you try using version 2.1.1. There were some changes in v2.1.0 that may have addressed the issue.
v 2.1.1 here and got the same issue. The textinput is updated, but the search is not triggered.
Ok. Can you try using version 2.1.1. There were some changes in v2.1.0 that may have addressed the issue.
i am having the same issue as well. Textinput triggered, but search not.
Same here using v2.1.2.
Is there any solution for this bug? The same issue I am facing search is not triggered with a predefined text.
Does anyone found a solution for this bug?
Most helpful comment
Does anyone found a solution for this bug?