Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Android AgendaList select date to scroll to the day not working properly. #2547

Open
madhav-nasit opened this issue Nov 4, 2024 · 0 comments

Comments

@madhav-nasit
Copy link

It shows previous date sticky in AgendaList when i select today in ExpandableCalendar

            <CalendarProvider
                date={Date.now()}
                showTodayButton
                theme={calenderTheme}
            >
                <ExpandableCalendar
                    firstDay={1}
                    markedDates={markedDates}
                    markingType="multi-dot"
                    theme={expandableCalendarTheme}
                    minDate={new Date().toISOString()}
                    style={styles.calendarView(insets)}
                />
                <View style={styles.eventListWrapper}>
                    <AgendaList
                        sections={eventsGroupedByDate}
                        renderItem={({item, index}) => <EventCard event={item} index={index} handleEventSelect={handleEventSelect} isSmall />}
                        scrollToNextEvent={false}
                        sectionStyle={styles.sectionStyle}
                        contentContainerStyle={styles.eventListContainer}
                    />
                </View>
            </CalendarProvider>

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-calendars/src/expandableCalendar/agendaList.js b/node_modules/react-native-calendars/src/expandableCalendar/agendaList.js
index d485d8d..b518bc2 100644
--- a/node_modules/react-native-calendars/src/expandableCalendar/agendaList.js
+++ b/node_modules/react-native-calendars/src/expandableCalendar/agendaList.js
@@ -114,7 +114,7 @@ const AgendaList = (props) => {
                 sectionIndex: sectionIndex,
                 itemIndex: 1,
                 viewPosition: 0,
-                viewOffset: (constants.isAndroid ? sectionHeight.current : 0) + viewOffset
+                viewOffset: viewOffset
             });
         }
     }, 1000, { leading: false, trailing: true }), [viewOffset, sections]);

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant