chore: fix menu navigation when focus is in input
This commit is contained in:
@@ -56,6 +56,12 @@ export const useListKeyboardNavigation = (
|
|||||||
|
|
||||||
const keyDownHandler = useCallback(
|
const keyDownHandler = useCallback(
|
||||||
(e: KeyboardEvent) => {
|
(e: KeyboardEvent) => {
|
||||||
|
const isFocusInInput = document.activeElement?.tagName === 'INPUT'
|
||||||
|
|
||||||
|
if (isFocusInInput) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (e.key === KeyboardKey.Up || e.key === KeyboardKey.Down) {
|
if (e.key === KeyboardKey.Up || e.key === KeyboardKey.Down) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user