react-native-calendars: Cant scroll CalendarList inside BottomSheet in Android
Description
Hi, i am using CalendarList inside the BottomSheetModal, in iOS works well but in android i can’t scroll
"@gorhom/bottom-sheet": "4.1.5",
"react-native-calendars": "^1.1277.0",
Expected Behavior
Hi, i am using CalendarList inside the BottomSheetModal, in iOS works well but in android i can’t scroll because react-native-calendars using flatList from ‘react-native’, i changed import of the FlatList from 'react-native to ‘react-native-gesture-handler’ and it works well. How can i fix that without changing code in node modules?
Environment
Emulator Pixel XL 4/ Android
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 15
I solving by add props to bottomsheet
`
<BottomSheet enableContentPanningGesture={false}
I added the property
customComponenttonode_modules/react-native-calendars/src/calendar-list/index.tsx, you can see details in https://github.com/wix/react-native-calendars/commit/f74d0f6a554257f7a69b80f4ed4eba6f2953263apull request: https://github.com/wix/react-native-calendars/pull/2331
@erickcrus - How do this work for you?
customComponentis not a prop thatCalendarListaccepts?You might want to try https://github.com/marceloPrado/flash-calendar - it has first party support for bottom sheet: https://marceloprado.github.io/flash-calendar/fundamentals/usage#bottom-sheet
<BottomSheetFlatList data={[0]} renderItem={() => ( <CalendarList customHeader={(date) => ( <CustomHeader month={date.month.toString(‘MMMM’)} year={date.month.getFullYear()} /> )} pastScrollRange={0} futureScrollRange={3} scrollEnabled={true} showScrollIndicator={false} markingType={‘custom’} dayComponent={(date, item, marking) => CustomDayComponent(date, item, marking) } markedDates={tempDates.markedDates} firstDay={1} calendarStyle={styles.container} dayTextFontSize={moderateScale(50)} minDate={ new Date(new Date().setDate(new Date().getDate() + 1)) .toISOString() .split(‘T’)[0] } maxDate={new Date(tempDates.maxDate).toISOString().split(‘T’)[0]} disableAllTouchEventsForDisabledDays={true} hideDayNames={true} theme={{ textDayFontSize: moderateScale(15), textMonthFontSize: moderateScale(14), textDayFontFamily: FONTS.Inter_600SemiBold, textMonthFontFamily: FONTS.Inter_600SemiBold, dayTextColor: ‘black’, todayTextColor: ‘#d9e1e8’, textDisabledColor: ‘#d9e1e8’ }} /> )} />
This solution works for me: