I'm using the command this.GooglePlaceRef.setAddressText("") after press a button with the intention to clear what was typed in the TextInput. Initially looked like it was working because the TextInput returned to its placeholder, but when I type a new letter, the value showed is the sum of the what it was typed before press the button with this new letter.
Example to a better understanding:
I type "Street" and press the clear button, the TextInput shows the placeholder, when I type the letter "a" the word showed is "Streeta".
And I used this dependency some months ago with the same code I'm using now and I remember that everything was working very fine.
text={this.state.value}
Do it null via state. on clear clicking button.
text={this.state.value}
Do it null via state. on clear clicking button.
Thanks for your reply @Biplovkumar, but the TextInput keeps the same behaviour that I described before.
use
<GooglePlacesAutocomplete
ref={c => this.googlePlacesAutocomplete = c}
and then usethis.googlePlacesAutocomplete._handleChangeText('');
this will clear the value
use
<GooglePlacesAutocomplete ref={c => this.googlePlacesAutocomplete = c}and then use
this.googlePlacesAutocomplete._handleChangeText('');this will clear the value
i am getting _handleChangeText is not a function, when i try to call this
use
<GooglePlacesAutocomplete ref={c => this.googlePlacesAutocomplete = c}and then use
this.googlePlacesAutocomplete._handleChangeText('');this will clear the value
The app project was freezed for some months and only some hours ago I could try your suggestion @i1990jain. Thanks for it but the autocomplete showed the same behavior described before.
I've already gave up because it's not a great flaw at all. However I won't close the issue because others suggestions can appear.
Most helpful comment
use
and then use
this.googlePlacesAutocomplete._handleChangeText('');this will clear the value