question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not click on location from the list on android device

See original GitHub issue

I got the list showing but I can not click on them (Can click on IOS Simulator but can not click on Android device) screenshot_20181207-124819_livvz

Here is my code

 <View style={[styles.containerTop]}>   
    <GooglePlacesAutocomplete
                        placeholder='Search'
                        minLength={2} // minimum length of text to search
                        autoFocus={false}
                        returnKeyType={'search'} // Can be left out for default return key https://facebook.github.io/react-native/docs/textinput.html#returnkeytype
                        listViewDisplayed='auto'
                        fetchDetails={true}
                        renderDescription={row => row.description} // custom description render
                        onPress={(data, location = null) => { // 'details' is provided when fetchDetails = true
                            console.log(data);
                            console.log(location);
                        }}
                        getDefaultValue={() => this.props.currentAddress}

                        query={{
                            // available options: https://developers.google.com/places/web-service/autocomplete
                            key: 'xxxxxxxxx',
                            language: 'en', // language of the results
                            types: '', // default: 'geocode'
                        }}
                        styles={{
                            description: {
                                fontWeight: 'bold',
                                backgroundColor: 'white',
                            },
                            predefinedPlacesDescription: {
                                color: '#1faadb',
                                backgroundColor: 'white',
                            },
                            textInputContainer: {
                                backgroundColor: 'rgba(47, 111, 45, 0.0)',
                                borderBottomWidth: 0,
                                borderTopWidth: 0,
                                zIndex: 500,
                            },
                            textInput: {
                                backgroundColor: 'white',
                                borderBottomWidth: 0.1,
                                borderColor: 'rgb(47, 111, 45, 0.1)',
                            },
                            listView: {
                                marginTop: 50,
                                elevation: 1,
                                backgroundColor: 'white',
                                position: 'absolute',
                                zIndex: 500,
                            },
                        }}

                        currentLocation={this.state.currentLocationStatus} // Will add a 'Current location' button at the top of the predefined places list
                        currentLocationLabel="Current location"
                        nearbyPlacesAPI='GooglePlacesSearch' // Which API to use: GoogleReverseGeocoding or GooglePlacesSearch
                        GoogleReverseGeocodingQuery={{
                            // available options for GoogleReverseGeocoding API : https://developers.google.com/maps/documentation/geocoding/intro
                        }}
                        GooglePlacesSearchQuery={{
                            // available options for GooglePlacesSearch API : https://developers.google.com/places/web-service/search
                            rankby: 'distance',
                            types: 'food',
                        }}

                        filterReverseGeocodingByTypes={['locality', 'administrative_area_level_3']} // filter the reverse geocoding results by types - ['locality', 'administrative_area_level_3'] if you want to display only cities

                        predefinedPlaces={this.state.predefinedList}

                        predefinedPlacesAlwaysVisible={true}
                    />
 </View>
    containerTop: {
        height: 0,
        flexDirection: 'row',
        padding: 25,
        paddingBottom: 50,
        marginTop: (isIphoneX() ? 20 : 0),
        zIndex: 200,
    },

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:17

github_iconTop GitHub Comments

10reactions
bell-stevencommented, May 10, 2020

Looks like this might have been resolved. Please open a new issue if this is still a problem.

10reactions
tvillafanecommented, Sep 13, 2019

What worked for me was the following (pseudo coded layout scheme):

<View flex={1}>
    <View style={{ position: 'relative', height: 50 }}>
        <Autocomplete style={{  container: { positition: 'absolute', height: 50 } }} />
    </View>
    <View style={{ flex: 1, zIndex: -1 }}>
        *ALL MY CONTENT*
    </View>
</View>

Make the header container which contains the autocomplete component have no z index stuff . and then put a negative zIndex on the container of the rest of your content. Works on my Pixel with Android 9

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage your Android device's location settings
Turn location on or off for your phone · Swipe down from the top of the screen. · Touch and hold Location ....
Read more >
Select Current Place and Show Details on a Map
Learn how to find find the current location of an Android device and display details of the place (a ... Select the project...
Read more >
Why is my Android phone location information wrong & how to ...
Why is my Android phone location information wrong & how to fix it ; Step 1. Go to Settings > Device care. ;...
Read more >
Troubleshooting the Phone Link app - Microsoft Support
Scroll down to Link to Windows, and then select Don't optimize. On select Android devices, the steps may be as follows: Open Android...
Read more >
Get the last known location - Android Developers
Using the Google Play services location APIs, your app can request the last known location of the user's device. In most cases, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found