Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,11 @@ function MoneyRequestReportActionsList({onLayout}: MoneyRequestReportListProps)
const initialNumToRender = useMemo((): number | undefined => {
const minimumReportActionHeight = styles.chatItem.paddingTop + styles.chatItem.paddingBottom + variables.fontSizeNormalHeight;
const availableHeight = windowHeight - (CONST.CHAT_FOOTER_MIN_HEIGHT + variables.contentHeaderHeight);
const numToRender = Math.ceil(availableHeight / minimumReportActionHeight);
// windowHeight can be smaller than the header+footer during transient mount/transition states
// (e.g. Wide RHP overlay animating in), which would make numToRender negative and crash
// VirtualizedList with "Invalid cells around viewport". Clamping to 0 lets the `|| undefined`
// fallback below kick in so FlatList uses its default.
const numToRender = Math.max(0, Math.ceil(availableHeight / minimumReportActionHeight));
if (linkedReportActionID) {
return getInitialNumToRender(numToRender);
}
Expand Down
Loading