react-native icon indicating copy to clipboard operation
react-native copied to clipboard

unable to scroll in scrollView in Android

Open johnneuland opened this issue 4 years ago • 5 comments

Description

I have a screen where I type in the input field and get search results accordingly. The list is rendered within a ScrollView but it still doesn't let me scroll when the keypad is open (in Android ). In iOS, it works fine.

I tried adding height: 80% to dropdown, it's parent container view. This makes it possible to scroll a bit. However, when the keypad is open I can scroll but not till the end of the list. If I add height: 100%, I am not able to scroll at all. I am already using flex:1in the scroll view as well as the parent view.

React Native version:

3.0.4

Steps To Reproduce

  return (
    <>
      {addressesFound.length > 0 ? (
        <ScrollView
          style={styles.searchResultsContainer}
          keyboardShouldPersistTaps={'always'}
          keyboardDismissMode={'on-drag'}>
          {addressesFound.map((addressDetails: addressDetailsType) => {
            return (
              <View
                key={addressDetails.placeName}
                style={styles.resultContainer}>
                <Text
                  style={styles.text}>
                  {addressDetails.placeName}
                </Text>
              </View>
            );
          })}
        </ScrollView>
      ) : null}
    </>
  );
};
const styles = StyleSheet.create({
  searchResultsContainer: {
    width: moderateScale(400),
    paddingHorizontal: moderateScale(50),
    paddingRight: moderateScale(65),
    marginTop: moderateScale(10),
   flex:1,
  },
  resultContainer: {
    marginTop: moderateScale(10),
    borderBottomWidth: 1,
    borderBottomColor: 'grey',
  },
  text: {
    fontSize: moderateScale(15),
  },
});

This is where the above mentioned component is called:

 <View style={styles.dropdown}>
          <LocationsFound
            addressesFound={locations.addressesFoundList} />
....
  dropdown: {
    position: 'absolute',
    top: moderateScale(215),
    zIndex: moderateScale(10),
    backgroundColor: '#fff',
    flex: 1,
  },

Expected Results

I should be able to scroll in Android too, till the end of the list when the keypad is open.

Snack, code example, screenshot, or link to a repository:

new

johnneuland avatar Aug 19 '20 16:08 johnneuland

I have similar issue. It only appear when ScrollView is in the tree that has position absolute.

danielhusar avatar Sep 11 '20 15:09 danielhusar

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

stale[bot] avatar Dec 25 '20 16:12 stale[bot]

Any solution? Still same problem with position: absolute ScrollView.

Ikalli avatar Oct 07 '22 08:10 Ikalli

Having the same issue with position: absolute in react-native v0.66.4. Any workarounds?

kmarple1 avatar Nov 28 '22 18:11 kmarple1

I'm also facing the same issue on android. Any solution?

Abhishek2250 avatar Jul 07 '23 12:07 Abhishek2250

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jan 04 '24 05:01 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jan 11 '24 05:01 github-actions[bot]