react-native
react-native copied to clipboard
unable to scroll in scrollView in Android
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:1
in 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:
I have similar issue.
It only appear when ScrollView
is in the tree that has position absolute.
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.
Any solution?
Still same problem with position: absolute
ScrollView.
Having the same issue with position: absolute
in react-native v0.66.4. Any workarounds?
I'm also facing the same issue on android. Any solution?
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.
This issue was closed because it has been stalled for 7 days with no activity.