Skip to content

Commit 708d447

Browse files
roryabrahamOSBotify
authored and
OSBotify
committed
Merge pull request #5954 from Santhosh-Sellavel/address_clear_vba_fix
(cherry picked from commit f5cff3f)
1 parent 766eb38 commit 708d447

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/AddressSearch.js

+8
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ const AddressSearch = (props) => {
107107
label: props.label,
108108
containerStyles: props.containerStyles,
109109
errorText: props.errorText,
110+
onChangeText: (text) => {
111+
const isTextValid = !_.isEmpty(text) && _.isEqual(text, props.value);
112+
113+
// Ensure whether an address is selected already or has address value initialized.
114+
if (!_.isEmpty(googlePlacesRef.current.getAddressText()) && !isTextValid) {
115+
saveLocationDetails({});
116+
}
117+
},
110118
}}
111119
styles={{
112120
textInputContainer: [styles.flexColumn],

0 commit comments

Comments
 (0)