Skip to content

Commit

Permalink
Revert "add workaround for RNW onBlur issue (#649)"
Browse files Browse the repository at this point in the history
This reverts commit ce02189.
  • Loading branch information
bell-steven committed Nov 11, 2020
1 parent 0af296c commit 78522f8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions GooglePlacesAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,6 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
};

const _onBlur = () => {
props.textInputProps.onBlur;
setListViewDisplayed(false);
inputRef?.current?.blur();
};
Expand Down Expand Up @@ -746,7 +745,7 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {

let {
onFocus,
onBlur,// destructuring here stops this being set after onBlur={_onBlur}
onBlur,
onChangeText, // destructuring here stops this being set after onChangeText={_handleChangeText}
clearButtonMode,
InputComp,
Expand Down Expand Up @@ -785,7 +784,14 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
}
: _onFocus
}
onBlur={_onBlur}
onBlur={
onBlur
? () => {
_onBlur();
onBlur();
}
: _onBlur
}
clearButtonMode={clearButtonMode || 'while-editing'}
onChangeText={_handleChangeText}
{...userProps}
Expand Down Expand Up @@ -883,9 +889,7 @@ GooglePlacesAutocomplete.defaultProps = {
styles: {},
suppressDefaultStyles: false,
textInputHide: false,
textInputProps: {
onBlur: () => '',
},
textInputProps: {},
timeout: 20000,
};

Expand Down

0 comments on commit 78522f8

Please sign in to comment.