Autocomplete does not work
See original GitHub issueMy component Search
import React, { Component } from 'react';
import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete';
import { Dimensions } from 'react-native';
export default class Search extends Component {
render() {
return <GooglePlacesAutocomplete
keyboardShouldPersistTaps='always'
placeholder="Para Onde ?"
placeholderTextColor="#333"
minLength={2} // minimum length of text to search
onPress={(data, details = null) => { // 'details' is provided when fetchDetails = true
console.log('pressinou');
console.log(data, details);
}}
query={{
key: 'MY-API-KEY',
language:'pt',
}}
nearbyPlacesAPI='GooglePlacesSearch'
textInputProps={{
autoCapitalize:"none",
autoCorrect:false,
}}
fetchDetails={true}
//enabledPoweredByContainer={false}
styles={{
container: {
position: "absolute",
top: Platform.select({ ios: 60, android: 40 }),
width: "100%"
},
textInputContainer: {
flex: 1,
backgroundColor: "transparent",
height: 54,
marginHorizontal: 20,
borderTopWidth: 0,
borderBottomWidth: 0
},
textInput: {
height: 54,
margin: 0,
borderRadius: 0,
paddingTop: 0,
paddingBottom: 0,
paddingLeft: 20,
paddingRight: 20,
marginTop: 0,
marginLeft: 0,
marginRight: 0,
elevation: 5,
shadowColor: "#000",
shadowOpacity: 0.1,
shadowOffset: { x: 0, y: 0 },
shadowRadius: 15,
borderWidth: 1,
borderColor: "#ddd",
fontSize: 18
},
listView: {
borderWidth: 1,
borderColor: "#ddd",
backgroundColor: "#fff",
marginHorizontal: 20,
elevation: 5,
shadowColor: "#000",
shadowOpacity: 0.1,
shadowOffset: { x: 0, y: 0 },
shadowRadius: 15,
marginTop: 10
},
description: {
fontSize: 16
},
row: {
padding: 20,
height: 58
}
}}
>
</GooglePlacesAutocomplete>;
}
}
And my index.js
import React, { Component } from 'react';
import MapView from 'react-native-maps';
import Geolocation from '@react-native-community/geolocation'; // instalar por causa da nova versao do REACT-NATIVE
import { View } from 'react-native';
import Search from '../Search';
// import { Container } from './styles';
// yarn add react-native-google-places-autocomplete
export default class Map extends Component {
state = {
region: null,
}
async componentDidMount() {
Geolocation.getCurrentPosition(
({
coords: { latitude, longitude }
}) => {
// console.log('latitude', latitude);
this.setState({
region: {
latitude,
longitude,
latitudeDelta: 0.0143,
longitudeDelta: 0.0134
}
})
// alert('pegou');
}, // sucesso
() => { alert(' erro ')}, // erro
{
timeout: 2000,
enableHighAccuracy: true,
maximumAge: 10000,
}
)
}
render() {
const { region } = this.state;
console.log('REGIAO', region);
return (
<View style={{ flex: 1 }} >
<MapView
style={{ flex: 1 }}
region={ region }
showsUserLocation
loadingEnabled
></MapView>
<Search>
</Search>
</View>
);
}
}
After put 2 or 3 digits of address, nothing happens
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Terminal autocomplete doesn't work properly - Ask Ubuntu
I use xfce4-terminal so I thought it might be the terminal and not the bash. But editing: ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4- ...
Read more >Google Search Autocomplete Not Working? Try This Fix - Alphr
If the autocomplete feature is enabled but still not working, try disabling the account sync feature in the You and Google tab as...
Read more >AutoComplete not working correctly - Outlook - Microsoft Learn
Check to see if AutoComplete is turned on · In Outlook, select File > Options. · Select the Mail tab. · Scroll roughly...
Read more >autocomplete not working on Chrome [closed] - Stack Overflow
I have a problem on our website where Chrome autocomplete seems not to work. It has been working in the past, but not...
Read more >Autocomplete does NOT work at all. #1695 - GitHub
Describe the current behavior: Tab only gives two spaces after say np. · Describe the expected behavior: autocomplete selection list should ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This package is no longer maintained and simply not working. I tried on IOS with expo. I didn’t even get a list of results. I found a other package that is working like a charm:
https://www.npmjs.com/package/react-native-places-input
Yes I solved re-install the components and use the flex:1.
Verify the key too, sometimes is only the wrong key.
RGDS
Em ter., 9 de fev. de 2021 às 15:11, Walter Devia notifications@github.com escreveu: