Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/hooks/useSearchHighlightAndScroll.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {useIsFocused} from '@react-navigation/native';
import {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {InteractionManager} from 'react-native';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import type {SearchQueryJSON} from '@components/Search/types';
import type {SearchListItem, SelectionListHandle, TransactionGroupListItemType, TransactionListItemType} from '@components/SelectionList/types';
Expand Down Expand Up @@ -112,7 +113,9 @@ function useSearchHighlightAndScroll({
triggeredByHookRef.current = true;

// Trigger the search
search({queryJSON, searchKey, offset, shouldCalculateTotals});
InteractionManager.runAfterInteractions(() => {
search({queryJSON, searchKey, offset, shouldCalculateTotals});
});

// Set the ref to prevent further triggers until reset
searchTriggeredRef.current = true;
Expand Down
Loading