React-native-google-places-autocomplete: How can i get onChangeText event on the input text ?

Created on 29 Nov 2017  路  5Comments  路  Source: FaridSafi/react-native-google-places-autocomplete

Most helpful comment

Just found the answer to this - the component has an undocumented textInputProps prop that accepts an onChangeText handler

Use it like this:

textInputProps={{
    onChangeText: (text) => { console.log(text) }
}}

All 5 comments

Just found the answer to this - the component has an undocumented textInputProps prop that accepts an onChangeText handler

Use it like this:

textInputProps={{
    onChangeText: (text) => { console.log(text) }
}}

This should be closed @FaridSafi :)

awesome!

@se1exin ... I want to use "ref" and "onSubmitEditing" props ... I tried your method but getting an error "undefined is not an object (evaluating '_this2.refs.businessaddress.focus') ... any suggestions ? I am new to react native

@Base29
You can try to add textInputProps on your googleMapAutocompleteInput with ref inside like this :

textInputProps={{
    onRef={(r) => this.googleMapInput = r}
}}

and in your TextInput before googleMapAutocompleteInput try to add this props :

              onSubmitEditing={() => this.googleMapInput.focus()}
              returnKeyType={ 'next' }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukBakTsh picture lukBakTsh  路  3Comments

sohel-tech picture sohel-tech  路  3Comments

akhlopyk picture akhlopyk  路  3Comments

aymkin picture aymkin  路  4Comments

tezahzulueta picture tezahzulueta  路  3Comments