Issues with Horizontal Scrolling in BottomSheetFlatList #2153
Unanswered
Thanisthani
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm experiencing an issue with the BottomSheetFlatList. When I implement a BottomSheetFlatList with horizontal scrolling, the Android app crashes, and on iOS the list becomes stuck while scrolling.
Below is a simplified version of my implementation:
<BottomSheetModal
ref={props.bottomSheetModalRef}
index={0}
backgroundStyle={styles.container}
backdropComponent={renderBackdrop}
enableDynamicSizing={false}
snapPoints={snapPoints}
<BottomSheetFlatList
data={Tags}
keyExtractor={(item, index) => index.toString()}
renderItem={renderTags}
contentContainerStyle={{
paddingTop: hp('1%'),
marginBottom: hp('1%'),
paddingHorizontal: wp('4%'),
}}
horizontal={true}
showsHorizontalScrollIndicator={false}
/>
And here is my renderTags function:
const renderTags = useCallback(
({ item, index }: any) => (
<TouchableWithoutFeedback
key={index}
onPress={() => {
setSelectedTag(item);
console.log('clicked', item);
}}
>
<View
style={{
borderWidth: 1,
borderColor:
selectedTag == item ? 'transparent' : ColorSheet.Border,
backgroundColor:
selectedTag == item ? ColorSheet.InputContainer : 'transparent',
paddingHorizontal: wp('3%'),
borderRadius: 40,
marginLeft: wp('2%'),
height: hp('5%'),
justifyContent: 'center',
alignItems: 'center',
minWidth: wp('13%'),
}}
>
<Text
style={[
globalStyles.h9,
{
fontFamily: 'Inter-Regular',
color:
selectedTag == item
? ColorSheet.InputText
: ColorSheet.Border,
},
]}
>
{item}
),
[selectedTag]
);
Questions
Has anyone encountered a similar issue with horizontal scrolling inside a BottomSheet?
Could this be related to gesture handling conflicts or reanimated animations?
Are there any known workarounds or fixes to allow horizontal scrolling without causing crashes or stuck scroll behaviour on iOS?
Beta Was this translation helpful? Give feedback.
All reactions