React-native-google-places-autocomplete: Bug Report - onPress callback is not working

Created on 10 Jun 2020  路  4Comments  路  Source: FaridSafi/react-native-google-places-autocomplete

Describe the bug

The function callback on onPress prop is not working when I tap on a item result

Reproduction - (required - issue will be closed without this)

Search an address and select one item of the result list

Please provide a FULLY REPRODUCIBLE example.


Click to expand!
Search an address and select one item of the result list, the console.log is now printing on the above code

```javascript
onPress={(data, details = null ) => {
console.log(data, details);
}}
query={{
key: MAPS_API_KEY,
language: 'en',
types: 'address',
}}
/>

```

_Please remember to remove you google API key from the code you provide here_

Additional context

  • Library Version: [1.7.1]
  • React Native Version: [0.61.4]

  • [x] iOS

  • [x] Android
  • [ ] Web

If you are using expo please indicate here:

  • [ ] I am using expo

Add any other context about the problem here, screenshots etc
image

bug

Most helpful comment

  • Do you have a scrollview wrapping the <GoogleAutocomplete/> component (see this)?
  • The code provided on its own does not reproduce the issue.

All 4 comments

  • Do you have a scrollview wrapping the <GoogleAutocomplete/> component (see this)?
  • The code provided on its own does not reproduce the issue.

Yes! Thank you so much! it works!

i'm facing the same problem, but only happens with IOS. I cant click in none of listview items(except if I click randomly several times over they).I'm not wraping a scrollview btw its inside a safeareaview and I'm using Expo

@itsGabriel can you try using <SafeAreaView /> from [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context)?

I've run into the same thing before. If you drop a link to a snack i'll be happy to take a look.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbelgrader picture mbelgrader  路  4Comments

quandevelopment picture quandevelopment  路  4Comments

lukBakTsh picture lukBakTsh  路  3Comments

tezahzulueta picture tezahzulueta  路  3Comments

aymkin picture aymkin  路  4Comments