Skip to content

Bug Report: I cannot scroll on Android, IOS scrolling works fine #971

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

Open
2 of 4 tasks
kanounzied opened this issue Apr 18, 2025 · 1 comment
Open
2 of 4 tasks
Labels

Comments

@kanounzied
Copy link

kanounzied commented Apr 18, 2025

Describe the bug

I am using this library following documentation, it works perfectly in IOS, but on android I am unable to scroll the result viewList.

what I tried:

I tried adding a ScrollView with the keyboardShouldPersistTaps and it didnt work.
I tried working with the default styling didnt work
I tried restyling all possible components and nothing.
I tried fixing a height for the listView and didnt work it seems like there is a style prop that is overriding my style config elsewhere.

It's become pretty frustrating as I do not want to implement all this logic myself.

Reproduction

My code

Click to expand!
<GooglePlacesAutocomplete
          enablePoweredByContainer={false}
          keyboardShouldPersistTaps={'always'}
          placeholder={'Search'}
          onFail={(e) => {
            console.log('Google places search error:', e);
          }}
          // renderRow={(data, index) => {
          //   // if (data.description === 'Current location') {
          //   //   setIsCurrentLocation(true);
          //   // } else {
          //   //   setIsCurrentLocation(false);
          //   // }
          //   return (
          //     <View key={index} style={styles.row}>
          //       {data.description === 'Current location' ? (
          //         <FontAwesomeIcon
          //           color={palette.blue['500']}
          //           icon={faLocationCrosshairs}
          //         />
          //       ) : null}
          //       <ThemedText style={{ fontSize: 14 }}>
          //         {data.description || data['name'] || data['vicinity']}
          //       </ThemedText>
          //     </View>
          //   );
          // }}
          textInputProps={{
            ...rest,
            onChangeText: (t) => {
              if (t !== 'Current location') {
                setSearch(t);
              }
            },
            onFocus: (e) => {
              onFocus?.(e);
              setIsFocused(true);
            },
            onBlur: (e) => {
              onBlur?.(e);
              setIsFocused(false);
            },
            placeholderTextColor: `${palette.text}4C`,
          }}
          onPress={(data, details = null) => {
            const address = extractAddressDetails(
              details.address_components,
              data.description,
            );
            onChange(address);
          }}
          currentLocation={true}
          currentLocationLabel="Current location"
          fetchDetails={true}
          query={{
            key: 'mykey',
            language: 'en',
          }}
          // suppressDefaultStyles={true}
          renderLeftButton={() => (
            <FontAwesomeIcon
              style={styles.leftIcon}
              icon={faLocationDot}
              size={17}
              color={palette.icon}
            />
          )}
          styles={{
            ...googleStyles,
            textInput: {
              ...googleStyles.textInput,
              color: palette.text,
              backgroundColor: palette.inputBackground,
            },
            listView: {
              ...googleStyles.listView,
              // flex: 1,
              height: 50,
              // position: 'absolute',
              // flexGrow: 1,
              // top: 50,
              backgroundColor: 'yellow',
            },
          }}
          disableScroll={false}
        />
  
  
# Additional context
  • Library Version: [e.g. 1.4.2]

  • React Native Version: [e.g. 0.62.2]

  • iOS

  • Android

  • Web

If you are using expo please indicate here:

  • I am using expo

Add any other context about the problem here, screenshots etc

@kanounzied kanounzied added the bug label Apr 18, 2025
@dpakakpo4
Copy link

Hi @kanounzied. Give it a try, I've wrote a specific hook for places API : [https://www.npmjs.com/package/rn-use-google-places-autocomplete](NPM LINK)

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

No branches or pull requests

2 participants