chore: fix workspace menu item escape

This commit is contained in:
Aman Harwara
2023-05-22 20:48:47 +05:30
parent d6843c207f
commit 56b4c1aa80

View File

@@ -44,8 +44,9 @@ const WorkspaceMenuItem: FunctionComponent<Props> = ({
}, []) }, [])
const handleInputKeyDown: KeyboardEventHandler = useCallback((event) => { const handleInputKeyDown: KeyboardEventHandler = useCallback((event) => {
if (event.key === KeyboardKey.Enter) { if (event.key === KeyboardKey.Enter || event.key === KeyboardKey.Escape) {
event.preventDefault() event.preventDefault()
event.stopPropagation()
itemRef.current?.focus() itemRef.current?.focus()
} }
}, []) }, [])