jaing / react-native-places-input

MIT License
46 stars 18 forks source link

Query could not clear when submit form #24

Closed mertaksu closed 4 years ago

mertaksu commented 4 years ago

First of all thanks for being a useful library. I am new in react native maybe i can miss some trips. When a place search after select and submit for input text value could not clear. I am using placeQuery state for keep input value. When i click to button i am setting placeQuery state to empty string but input text could not clear.

query={this.state.placeQuery || ''} googleApiKey={API_KEY} placeHolder="Arazi Lokasyonu" language={'tr'} queryCountries={['tr']} onSelect={place => { this.setState({selectedPlaceLat : place.result.geometry.location.lat, selectedPlaceLon: place.result.geometry.location.lat, placeQuery: ''}); }}

Submit button function inside

this.setState({landName: '',placeQuery: '',selectedPlaceLat: '',selectedPlaceLon:'',error:''});

Ekran Resmi 2020-05-18 02 20 29
jaing commented 4 years ago

Please try 1.1.5. Component now will update a query value on prop change and there is a new config to clear query on palce select