I tried to put this prop like true autoFocus={true} but it doesn't work on release, when I test my app on debug it works perfectly but when I tried to test it on release the autoFocus equal true doesn't works on android and iOS
I've been working around this issue and I've found a way to make it works
<GooglePlacesAutocomplete
placeholder={I18n.t("delivery.placeholderSearch")}
minLength={2}
fetchDetails={true}
listViewDisplayed="auto"
query={{
key: "xxxxxxxxxxxxxxxxxxxxxxxx",
language: "en",
types: "geocode"
}}
onPress={(data, details = null) => {
this.newCoordinates(details);
}}
getDefaultValue={() => this.state.keyword}
renderLeftButton={this.renderLeftButtom}
renderRow={this.renderRow}
styles={styles}
style={styles.inputSearch}
textInputProps={{
ref: textInput => {
if (this.props.autofocus) {
textInput && textInput.focus();
}
if (this.state.showMap) {
textInput && textInput.blur();
}
}
}}
/>
Hello! This appears to still be broken on both Android and iOS. I've worked around it with this code snippet (the above didn't work either), but it still appears to be a bug:
textInputProps={{
// Super hacky..
ref: (textInput) => {
setTimeout(() => textInput && textInput.focus(), 100);
},
}}
Hello! This appears to still be broken on both Android and iOS. I've worked around it with this code snippet (the above didn't work either), but it still appears to be a bug:
textInputProps={{ // Super hacky.. ref: (textInput) => { setTimeout(() => textInput && textInput.focus(), 100); }, }}
It works but I've used GooglePlacesAutocomplete in modal while setting modal visible it focus automatically but when I dismiss modal it gives me error -
Exception 'Bridge module `(null)` does not conform to RCTBridgeModule' was thrown while invoking dispatchViewManagerCommand on target UIManager with params (
199,
focus,
(
)
)
Most helpful comment
Hello! This appears to still be broken on both Android and iOS. I've worked around it with this code snippet (the above didn't work either), but it still appears to be a bug: