diff --git a/src/libs/actions/IOU/index.ts b/src/libs/actions/IOU/index.ts index 4caa9400bc6f..8d57b2fd2e0e 100644 --- a/src/libs/actions/IOU/index.ts +++ b/src/libs/actions/IOU/index.ts @@ -14367,7 +14367,14 @@ function updateSplitTransactionsFromSplitExpensesFlow(params: UpdateSplitTransac const transactionThreadReportScreen = Navigation.getReportRouteByID(transactionThreadReportID); // Reset selected transactions in search after saving split expenses - params?.searchContext?.clearSelectedTransactions?.(undefined, true); + const searchFullScreenRoutes = navigationRef.getRootState()?.routes.findLast((route) => route.name === NAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR); + const lastRoute = searchFullScreenRoutes?.state?.routes?.at(-1); + const isUserOnSearchPage = isSearchTopmostFullScreenRoute() && lastRoute?.name === SCREENS.SEARCH.ROOT; + if (isUserOnSearchPage) { + params?.searchContext?.clearSelectedTransactions?.(undefined, true); + } else { + params?.searchContext?.clearSelectedTransactions?.(true); + } if (isSearchPageTopmostFullScreenRoute || !transactionReport?.parentReportID) { Navigation.dismissModal();