diff --git a/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx b/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx index 7a607051dfe4..f404c1ee9d97 100644 --- a/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx +++ b/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx @@ -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); }