-
Notifications
You must be signed in to change notification settings - Fork 171
Open
Labels
Description
When you click on the 'X' to clear the input value, the state for that input value is not getting updated.
<GooglePlacesAutocomplete
selectProps={{
inputId: "pickUPLocation",
value: originAddr,
placeholder: "Pickup Location",
onChange: (place) => { handleOriginChange(place) },
isClearable: true,
autoFocus: true,
className: "w-full text-black",
components: {
DropdownIndicator: false
},
styles: {
control: (provided) => ({
...provided,
backgroundColor: 'transparent',
border: 'none'
})
}
}}
/>
const handleOriginChange = async (place) => {
if(!place) return;
setOriginAddr(place.formatted_address)
const originDetails = await getLatAndLng(place);
setOrigin(originDetails);
};