jaing / react-native-places-input

MIT License
46 stars 18 forks source link

Selecting address innside scrollview doesn't fire select #8

Closed bruxalldev closed 4 years ago

bruxalldev commented 4 years ago

Hi thanks for creating this component it's saved me heaps of time.

I have found something interesting though - I'm using the address lookup in my form which worked well until I had to have the address lookup inside a scrollview...

This works as expected and the select is fired on tap and I get the address

<View style={{marginTop: 200, zIndex: 300}}>
              <PlacesInput
                googleApiKey={'KEY'}
                language={'en-US'}
                onSelect={place => this.fillForm(place)}
                queryCountries={['nz']}
              />
</View>

This works but DOES NOT fire the select on tap so I don't get the address

<ScrollView style={{marginTop: 200, zIndex: 300}}>
              <PlacesInput
                googleApiKey={'KEY'}
                language={'en-US'}
                onSelect={place => this.fillForm(place)}
                queryCountries={['nz']}
              />
</ScrollView>

Any thoughts - I think it may have something to do with the list being inside a scrollview.

React Native 0.61.5 - iOS 13

jaing commented 4 years ago

Can you try using:

   <ScrollView
                keyboardShouldPersistTaps="always"
thecookieorg commented 4 years ago

I'm experiencing the same issue since yesterday. Everything was working fine, and suddenly it just stopped working.

Update - suggested fix is working. 😄

bruxalldev commented 4 years ago

This fix works

<ScrollView keyboardShouldPersistTaps="always" style={{marginTop: 200, zIndex: 300}}> <PlacesInput googleApiKey={'KEY'} language={'en-US'} onSelect={place => this.fillForm(place)} queryCountries={['nz']} />

THank you for the quick response