FaridSafi / react-native-google-places-autocomplete

Customizable Google Places autocomplete component for iOS and Android React-Native apps
MIT License
1.98k stars 846 forks source link

Bug Report #941

Open SharanyaSirigiri opened 3 months ago

SharanyaSirigiri commented 3 months ago

OnPress event not working on iOS devices.

The component is reloading many times unnecessarily and the onPress event is not working when clicked on any address. No feedback also given.

To reproduce the issue try to run GooglePlacesAutoComplete in an iOS real device.

The code I have used for GooglePlacesAutoComplete ` <ScrollView keyboardShouldPersistTaps={'handled'} >

      <GooglePlacesAutocomplete
        placeholder="Search"
        fetchDetails
        onPress={(data, details) => {
          console.log('Onpress working');
          moveToLocation(
            details?.geometry.location.lat,
            details?.geometry.location.lng,
          );
        }}
        debounce={300}
        listViewDisplayed={false}
        query={{
          key: GOOGLE_API_KEY,
          language: 'en',
        }}
        disableScroll
        onFail={error => {
          console.log('[MapScreen] ', error);
        }}
      />
    </ScrollView>`

It was working fine when initially tested.

I am using a React Native CLI applications.

Add any other context about the problem here, screenshots etc

KrisLau commented 1 month ago

Not sure if this helps you but you should probably downgrade to 2.5.1 if your old tests work? I had issues with 2.5.6 and I couldn't figure it out because the releases from 2.5.1 aren't shown so I can't diff the two versions