Skip to content

Commit ffdee18

Browse files
authored
Enhance infiniteAgendaList (#2278)
1 parent ad6f5dc commit ffdee18

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/expandableCalendar/agendaList.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export interface AgendaListProps extends SectionListProps<any, DefaultSectionT>
6767
infiniteListProps?: {
6868
itemHeight?: number;
6969
titleHeight?: number;
70+
visibleIndicesChangedDebounce?: number;
71+
renderFooter?: () => React.ReactElement | null;
7072
};
7173
}
7274

src/expandableCalendar/infiniteAgendaList.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const InfiniteAgendaList = (props: AgendaListProps) => {
181181
}
182182
}
183183
}
184-
}, 1000, {leading: false, trailing: true},), [avoidDateUpdates, setDate, data]);
184+
}, infiniteListProps?.visibleIndicesChangedDebounce ?? 1000, {leading: false, trailing: true},), [avoidDateUpdates, setDate, data]);
185185

186186
const findItemTitleIndex = useCallback((itemIndex: number) => {
187187
let titleIndex = itemIndex;
@@ -236,10 +236,11 @@ const InfiniteAgendaList = (props: AgendaListProps) => {
236236
layoutProvider={layoutProvider}
237237
onScroll={_onScroll}
238238
onVisibleIndicesChanged={_onVisibleIndicesChanged}
239-
scrollViewProps={{onMomentumScrollEnd: _onMomentumScrollEnd}}
239+
scrollViewProps={{onMomentumScrollEnd: _onMomentumScrollEnd, nestedScrollEnabled: true}}
240240
onEndReached={_onEndReached}
241241
onEndReachedThreshold={onEndReachedThreshold as number | undefined}
242242
disableScrollOnDataChange
243+
renderFooter={infiniteListProps?.renderFooter}
243244
/>
244245
);
245246
};

src/infinite-list/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface InfiniteListProps
2727
positionIndex?: number;
2828
layoutProvider?: LayoutProvider;
2929
disableScrollOnDataChange?: boolean;
30+
renderFooter?: () => React.ReactElement | null;
3031
}
3132

3233
const InfiniteList = (props: InfiniteListProps, ref: any) => {
@@ -51,6 +52,7 @@ const InfiniteList = (props: InfiniteListProps, ref: any) => {
5152
layoutProvider,
5253
onScroll,
5354
onEndReached,
55+
renderFooter,
5456
} = props;
5557

5658
const dataProvider = useMemo(() => {
@@ -179,6 +181,7 @@ const InfiniteList = (props: InfiniteListProps, ref: any) => {
179181
onEndReached={onEndReached}
180182
onEndReachedThreshold={onEndReachedThreshold}
181183
onVisibleIndicesChanged={onVisibleIndicesChanged}
184+
renderFooter={renderFooter}
182185
/>
183186
);
184187
};

0 commit comments

Comments
 (0)