Skip to content

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

@kanounzied

Description

@kanounzied

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions