From 5fb04e38a1a9b282b67d47637cc26eeea9a1b029 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Mon, 24 Apr 2023 16:28:41 +0530 Subject: [PATCH] chore: fix menu navigation when focus is in input --- .../web/src/javascripts/Hooks/useListKeyboardNavigation.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/web/src/javascripts/Hooks/useListKeyboardNavigation.ts b/packages/web/src/javascripts/Hooks/useListKeyboardNavigation.ts index 88c6241fe..14a6d3f9c 100644 --- a/packages/web/src/javascripts/Hooks/useListKeyboardNavigation.ts +++ b/packages/web/src/javascripts/Hooks/useListKeyboardNavigation.ts @@ -56,6 +56,12 @@ export const useListKeyboardNavigation = ( const keyDownHandler = useCallback( (e: KeyboardEvent) => { + const isFocusInInput = document.activeElement?.tagName === 'INPUT' + + if (isFocusInInput) { + return + } + if (e.key === KeyboardKey.Up || e.key === KeyboardKey.Down) { e.preventDefault() } else {