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
10 changes: 7 additions & 3 deletions src/pages/inbox/report/ReportActionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,10 @@ function ReportActionsList({
// In case of an error we want to display the header no matter what.
if (!canShowHeader) {
hasHeaderRendered.current = true;
return null;

// Empty spacer so FlashList wraps a header and ListHeaderComponentStyle (flex: 1) applies —
// the wrapper sits at the visual bottom of the inverted list and pins items to the visual top.
return shouldBeAlignedToTop ? <View /> : null;
}

return (
Expand All @@ -831,7 +834,7 @@ function ReportActionsList({
hasActiveDraft={hasActiveDraft}
/>
);
}, [canShowHeader, hasActiveDraft, report.reportID, retryLoadNewerChatsError]);
}, [canShowHeader, hasActiveDraft, report.reportID, retryLoadNewerChatsError, shouldBeAlignedToTop]);

const shouldShowSkeleton = isOffline && !sortedVisibleReportActions.some((action) => action.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED);

Expand Down Expand Up @@ -902,12 +905,13 @@ function ReportActionsList({
keyExtractor={keyExtractor}
drawDistance={1500}
renderScrollComponent={renderActionSheetAwareScrollView}
contentContainerStyle={[styles.chatContentScrollView, shouldBeAlignedToTop && styles.justifyContentEnd]}
contentContainerStyle={styles.chatContentScrollView}
onEndReached={onEndReached}
onEndReachedThreshold={0.75}
onStartReached={handleStartReached}
onStartReachedThreshold={0.75}
ListHeaderComponent={listHeaderComponent}
ListHeaderComponentStyle={shouldBeAlignedToTop ? styles.flex1 : undefined}
ListFooterComponent={listFooterComponent}
keyboardShouldPersistTaps="handled"
onLayout={onLayoutInner}
Expand Down
Loading