react-native-google-places-autocomplete
react-native-google-places-autocomplete copied to clipboard
Feature Request: onClear callback
Is your feature request related to a problem? Please describe.
I currently use the results of the Autocomplete in a form. When the user presses the X
to clear, I need to capture this event so I can update my form state.
A clear and concise description of what the problem is. As a user, I should be able to clear the form and have it update accurately. As a developer, I should be able to capture the clearing of the form as an event to update internal state so the form is not submitted with stale data.
Describe the solution you'd like
When the user presses the X
there should be an event that captures this, as a callback.
A clear and concise description of what you want to happen.
Create a callback onClear
prop that is a simple () => void
type so I can handle what I need.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
onChangeText: val => {
if ((!val && field.value.place) || field.value.details) {
handleSelection();
}
},
Additional context
Add any other context or screenshots about the feature request here.