Skip to content

Commit

Permalink
Merge pull request #5954 from Santhosh-Sellavel/address_clear_vba_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Oct 22, 2021
2 parents 0f21667 + 51a60d2 commit f5cff3f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/AddressSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ const AddressSearch = (props) => {
label: props.label,
containerStyles: props.containerStyles,
errorText: props.errorText,
onChangeText: (text) => {
const isTextValid = !_.isEmpty(text) && _.isEqual(text, props.value);

// Ensure whether an address is selected already or has address value initialized.
if (!_.isEmpty(googlePlacesRef.current.getAddressText()) && !isTextValid) {
saveLocationDetails({});
}
},
}}
styles={{
textInputContainer: [styles.flexColumn],
Expand Down

0 comments on commit f5cff3f

Please sign in to comment.