From c317f1b16789d451583f3eef5fd2eccd1f6f5cec Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Mon, 25 Aug 2025 12:06:55 +0800 Subject: [PATCH] Fix: Selection mode remains active after moving/removing the selected expense --- src/pages/iou/request/step/IOURequestStepReport.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/iou/request/step/IOURequestStepReport.tsx b/src/pages/iou/request/step/IOURequestStepReport.tsx index ce32ade036a9..92245312912d 100644 --- a/src/pages/iou/request/step/IOURequestStepReport.tsx +++ b/src/pages/iou/request/step/IOURequestStepReport.tsx @@ -1,5 +1,6 @@ import React from 'react'; import {InteractionManager} from 'react-native'; +import {useSearchContext} from '@components/Search/SearchContext'; import type {ListItem} from '@components/SelectionList/types'; import useOnyx from '@hooks/useOnyx'; import useShowNotFoundPageInIOUStep from '@hooks/useShowNotFoundPageInIOUStep'; @@ -30,6 +31,7 @@ function IOURequestStepReport({route, transaction}: IOURequestStepReportProps) { const reportID = isUnreported ? transaction?.participants?.at(0)?.reportID : transaction?.reportID; const [transactionReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(reportID)}`, {canBeMissing: false}); const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: true}); + const {removeTransaction} = useSearchContext(); const isEditing = action === CONST.IOU.ACTION.EDIT; const isCreateReport = action === CONST.IOU.ACTION.CREATE; @@ -94,6 +96,7 @@ function IOURequestStepReport({route, transaction}: IOURequestStepReportProps) { if (isEditing) { changeTransactionsReport([transaction.transactionID], item.value, allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${item.policyID}`]); + removeTransaction(transaction.transactionID); } }); }; @@ -127,6 +130,7 @@ function IOURequestStepReport({route, transaction}: IOURequestStepReportProps) { Navigation.dismissModal(); InteractionManager.runAfterInteractions(() => { changeTransactionsReport([transaction.transactionID], CONST.REPORT.UNREPORTED_REPORT_ID); + removeTransaction(transaction.transactionID); }); };