File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import type {SearchQueryJSON} from '@components/Search/types';
77import type { SelectionListHandle } from '@components/SelectionList/types' ;
88import { search } from '@libs/actions/Search' ;
99import { mergeTransactionIdsHighlightOnSearchRoute } from '@libs/actions/Transaction' ;
10+ import isSearchTopmostFullScreenRoute from '@libs/Navigation/helpers/isSearchTopmostFullScreenRoute' ;
1011import { isReportActionEntry } from '@libs/SearchUIUtils' ;
1112import type { SearchKey } from '@libs/SearchUIUtils' ;
1213import CONST from '@src/CONST' ;
@@ -100,8 +101,12 @@ function useSearchHighlightAndScroll({
100101
101102 // Check if there is a change in the transactions or report actions list
102103 if ( ( ! isChat && hasTransactionsIDsChange ) || hasReportActionsIDsChange || hasPendingSearchRef . current ) {
103- // If we're not focused or offline, don't trigger search
104- if ( ! isFocused || isOffline ) {
104+ // Skip if offline, or if the user has navigated to a different fullscreen page entirely.
105+ // An RHP layered on top of Search makes `isFocused` false but keeps Search as the topmost
106+ // fullscreen route, so we still want to refetch — otherwise the snapshot can't reflect
107+ // entries the user creates from the RHP until they close it.
108+ const isSearchStillActive = isFocused || isSearchTopmostFullScreenRoute ( ) ;
109+ if ( ! isSearchStillActive || isOffline ) {
105110 hasPendingSearchRef . current = true ;
106111 return ;
107112 }
You can’t perform that action at this time.
0 commit comments