@@ -821,7 +821,10 @@ function ReportActionsList({
821821 // In case of an error we want to display the header no matter what.
822822 if ( ! canShowHeader ) {
823823 hasHeaderRendered . current = true ;
824- return null ;
824+
825+ // Empty spacer so FlashList wraps a header and ListHeaderComponentStyle (flex: 1) applies —
826+ // the wrapper sits at the visual bottom of the inverted list and pins items to the visual top.
827+ return shouldBeAlignedToTop ? < View /> : null ;
825828 }
826829
827830 return (
@@ -831,7 +834,7 @@ function ReportActionsList({
831834 hasActiveDraft = { hasActiveDraft }
832835 />
833836 ) ;
834- } , [ canShowHeader , hasActiveDraft , report . reportID , retryLoadNewerChatsError ] ) ;
837+ } , [ canShowHeader , hasActiveDraft , report . reportID , retryLoadNewerChatsError , shouldBeAlignedToTop ] ) ;
835838
836839 const shouldShowSkeleton = isOffline && ! sortedVisibleReportActions . some ( ( action ) => action . actionName === CONST . REPORT . ACTIONS . TYPE . CREATED ) ;
837840
@@ -902,12 +905,13 @@ function ReportActionsList({
902905 keyExtractor = { keyExtractor }
903906 drawDistance = { 1500 }
904907 renderScrollComponent = { renderActionSheetAwareScrollView }
905- contentContainerStyle = { [ styles . chatContentScrollView , shouldBeAlignedToTop && styles . justifyContentEnd ] }
908+ contentContainerStyle = { styles . chatContentScrollView }
906909 onEndReached = { onEndReached }
907910 onEndReachedThreshold = { 0.75 }
908911 onStartReached = { handleStartReached }
909912 onStartReachedThreshold = { 0.75 }
910913 ListHeaderComponent = { listHeaderComponent }
914+ ListHeaderComponentStyle = { shouldBeAlignedToTop ? styles . flex1 : undefined }
911915 ListFooterComponent = { listFooterComponent }
912916 keyboardShouldPersistTaps = "handled"
913917 onLayout = { onLayoutInner }
0 commit comments