diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 83733b9013c9..035f1f8dd7a4 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -301,7 +301,7 @@ function Search({queryJSON, searchResults, onSearchListScroll, contentContainerS // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps }, []); - const isSearchResultsEmpty = !searchResults?.data || isSearchResultsEmptyUtil(searchResults); + const isSearchResultsEmpty = !searchResults?.data || isSearchResultsEmptyUtil(searchResults, groupBy); useEffect(() => { if (!isFocused) { diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index 21cf66b45df1..6df7d307984e 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -1781,7 +1781,10 @@ function getSortedReportActionData(data: ReportActionListItemType[], localeCompa /** * Checks if the search results contain any data, useful for determining if the search results are empty. */ -function isSearchResultsEmpty(searchResults: SearchResults) { +function isSearchResultsEmpty(searchResults: SearchResults, groupBy?: SearchGroupBy) { + if (groupBy !== CONST.SEARCH.GROUP_BY.REPORTS) { + return !Object.keys(searchResults?.data).some((key) => isGroupEntry(key)); + } return !Object.keys(searchResults?.data).some( (key) => key.startsWith(ONYXKEYS.COLLECTION.TRANSACTION) &&