From ee3fb21d63e3e022f395e52ae339033090d4472f Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 17 Oct 2024 11:00:27 -0600 Subject: [PATCH] Merge pull request #51032 from software-mansion-labs/kicu/50982-search-fixes [CP Staging] Fix Search back button on mWeb and report opening in Search (cherry picked from commit 20b85d5e756050bd305d786d9c9d318949fa18ab) (CP triggered by luacmartins) --- .../Search/SearchRouter/SearchRouterList.tsx | 2 +- .../Search/SearchRouter/SearchRouterModal.tsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/Search/SearchRouter/SearchRouterList.tsx b/src/components/Search/SearchRouter/SearchRouterList.tsx index 9830ea4e9506..d8a373183077 100644 --- a/src/components/Search/SearchRouter/SearchRouterList.tsx +++ b/src/components/Search/SearchRouter/SearchRouterList.tsx @@ -167,7 +167,7 @@ function SearchRouterList( if ('reportID' in item && item?.reportID) { Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(item?.reportID)); } else if ('login' in item) { - Report.navigateToAndOpenReport(item?.login ? [item.login] : []); + Report.navigateToAndOpenReport(item.login ? [item.login] : [], false); } }, [closeAndClearRouter, onSearchSubmit, currentQuery, updateUserSearchQuery], diff --git a/src/components/Search/SearchRouter/SearchRouterModal.tsx b/src/components/Search/SearchRouter/SearchRouterModal.tsx index 7e403461dd34..62cdb38246b4 100644 --- a/src/components/Search/SearchRouter/SearchRouterModal.tsx +++ b/src/components/Search/SearchRouter/SearchRouterModal.tsx @@ -2,6 +2,7 @@ import React from 'react'; import FocusTrapForModal from '@components/FocusTrap/FocusTrapForModal'; import Modal from '@components/Modal'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; +import * as Browser from '@libs/Browser'; import CONST from '@src/CONST'; import SearchRouter from './SearchRouter'; import {useSearchRouterContext} from './SearchRouterContext'; @@ -15,12 +16,17 @@ function SearchRouterModal() { return ( - {isSearchRouterDisplayed && } + {isSearchRouterDisplayed && ( + + + + )} ); }