Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of places keeps popping up when trying to type on a different textInput #567

Closed
fbotalla opened this issue May 23, 2020 · 7 comments
Closed

Comments

@fbotalla
Copy link

fbotalla commented May 23, 2020

const GoogleAutocomplete = (props) =>{
    return(
    <GooglePlacesAutocomplete
            placeholder={props.placeholder} 
            minLength={2}
            value = {props.value}
            keyboardAppearance={'light'}
            autoFocus = {false}
            fetchDetails={true} 
            onPress = {props.onPress}
            query={{
                key: 'myKey',
                language: 'en', // language of the results
                }}
            styles={{
                textInputContainer: {
                    backgroundColor: 'rgba(0,0,0,0)', 
                    borderTopWidth: 0,
                    borderBottomWidth:0,
                    paddingLeft: 50,
                    paddingRight: 50,
                    },
                loader:{
                    height:100,
                },
                textInput: {
                    fontSize: 16,
                    fontFamily:'Bellota-Regular'
                    },
                }}/>
    )
}

export default GoogleAutocomplete;

Above is my component. Each time I click on different <TextInput> and I start to type, the drop-down with all the places that I found previously opens up. How do I disable this behavior?

@bell-steven
Copy link
Collaborator

bell-steven commented May 24, 2020

@fbotalla There was fix that was released for this in the latest version (1.7.1)
Please follow the issue template. If the information in the template is provided, I can try and help you out.

@fbotalla
Copy link
Author

@bell-steven Thank you for redirecting me to the documentation. Would this only work with a class component? What if I wanted to only use this as a functional component?

@bell-steven
Copy link
Collaborator

bell-steven commented May 24, 2020

It doesn't matter what type of component you use, class or functional. What version of the library are you using? This seems like it might be a duplicate of #566 .

@fbotalla
Copy link
Author

I am using "react-native-google-places-autocomplete": "^1.7.1"

@bell-steven
Copy link
Collaborator

Can you provide a minimal code reproduction either here or in a snack?

@fbotalla
Copy link
Author

@bell-steven Never mind, I ran an npm update on the project and it works great now!

@bell-steven
Copy link
Collaborator

No worries. Glad you got it sorted out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants