Skip to content

Commit cceddfb

Browse files
Revert renderTopReportActions to pass global index
The preview-local map index doesn't match the global list index, which can cause wrong scroll behavior for draft dismiss/save. Use actionIndexMap to pass the correct global index. Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
1 parent b9d902d commit cceddfb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/pages/inbox/report/ReportActionsList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -859,18 +859,18 @@ function ReportActionsList({
859859
<>
860860
{!shouldShowReportRecipientLocalTime && !hideComposer && <View style={[styles.stickToBottom, styles.appBG, styles.zIndex10, styles.height4]} />}
861861
<StaticReportActionsPreview>
862-
{previewItems.map((action, index) => (
862+
{previewItems.map((action) => (
863863
<View key={action.reportActionID}>
864864
{renderItem({
865865
item: action,
866-
index,
866+
index: actionIndexMap.get(action.reportActionID) ?? 0,
867867
} as ListRenderItemInfo<OnyxTypes.ReportAction>)}
868868
</View>
869869
))}
870870
</StaticReportActionsPreview>
871871
</>
872872
);
873-
}, [hideComposer, initialNumToRender, renderItem, shouldShowReportRecipientLocalTime, sortedVisibleReportActions, styles]);
873+
}, [actionIndexMap, hideComposer, initialNumToRender, renderItem, shouldShowReportRecipientLocalTime, sortedVisibleReportActions, styles]);
874874

875875
const onStartReached = useCallback(() => {
876876
if (!isSearchTopmostFullScreenRoute()) {

0 commit comments

Comments
 (0)