diff --git a/src/components/Search/SearchList/BaseSearchList/index.tsx b/src/components/Search/SearchList/BaseSearchList/index.tsx index 678a73793d2af..ad5c57208d387 100644 --- a/src/components/Search/SearchList/BaseSearchList/index.tsx +++ b/src/components/Search/SearchList/BaseSearchList/index.tsx @@ -54,6 +54,7 @@ function BaseSearchList({ }, ...(!hasKeyBeenPressed.current && {setHasKeyBeenPressed}), isFocused, + captureOnInputs: false, }); const renderItemWithKeyboardFocus = useCallback( diff --git a/src/components/Search/SearchPageHeader/SearchPageHeaderInput.tsx b/src/components/Search/SearchPageHeader/SearchPageHeaderInput.tsx index 4ecd440d4a51c..999320712ae1d 100644 --- a/src/components/Search/SearchPageHeader/SearchPageHeaderInput.tsx +++ b/src/components/Search/SearchPageHeader/SearchPageHeaderInput.tsx @@ -402,6 +402,7 @@ function SearchPageHeaderInput({queryJSON, searchRouterListVisible, hideSearchRo reports={reports} allCards={allCards} allFeeds={allFeeds} + textInputRef={textInputRef} /> )} @@ -476,6 +477,7 @@ function SearchPageHeaderInput({queryJSON, searchRouterListVisible, hideSearchRo reports={reports} allCards={allCards} allFeeds={allFeeds} + textInputRef={textInputRef} /> )} diff --git a/src/hooks/useArrowKeyFocusManager.ts b/src/hooks/useArrowKeyFocusManager.ts index a28eff02d5b88..e34de627b3e7b 100644 --- a/src/hooks/useArrowKeyFocusManager.ts +++ b/src/hooks/useArrowKeyFocusManager.ts @@ -9,6 +9,7 @@ type Config = { onFocusedIndexChange?: (index: number) => void; initialFocusedIndex?: number; disabledIndexes?: readonly number[]; + captureOnInputs?: boolean; shouldExcludeTextAreaNodes?: boolean; isActive?: boolean; itemsPerRow?: number; @@ -46,6 +47,7 @@ export default function useArrowKeyFocusManager({ // The "disabledIndexes" array needs to be stable to prevent the "useCallback" hook from being recreated unnecessarily. // Hence the use of CONST.EMPTY_ARRAY. disabledIndexes = CONST.EMPTY_ARRAY, + captureOnInputs = true, shouldExcludeTextAreaNodes = true, isActive, itemsPerRow, @@ -63,16 +65,18 @@ export default function useArrowKeyFocusManager({ () => ({ excludedNodes: shouldExcludeTextAreaNodes ? ['TEXTAREA'] : [], isActive, + captureOnInputs, }), - [isActive, shouldExcludeTextAreaNodes], + [captureOnInputs, isActive, shouldExcludeTextAreaNodes], ); const horizontalArrowConfig = useMemo( () => ({ excludedNodes: shouldExcludeTextAreaNodes ? ['TEXTAREA'] : [], isActive: isActive && allowHorizontalArrowKeys, + captureOnInputs, }), - [isActive, shouldExcludeTextAreaNodes, allowHorizontalArrowKeys], + [allowHorizontalArrowKeys, captureOnInputs, isActive, shouldExcludeTextAreaNodes], ); useEffect(() => {