diff --git a/src/shared/components/query/StudySearch.tsx b/src/shared/components/query/StudySearch.tsx index 56ade8f6044..438742ffe23 100644 --- a/src/shared/components/query/StudySearch.tsx +++ b/src/shared/components/query/StudySearch.tsx @@ -47,11 +47,10 @@ export const StudySearch: FunctionComponent = observer( }, []); const onKeyDownSearchBox = useCallback( - (e: React.KeyboardEvent) => { - if ([13, 27].includes(e.keyCode)) { + async (e: React.KeyboardEvent) => { + if (store.isMenuOpen) { + await sleep(500); store.setMenuOpen(false); - } else { - store.setMenuOpen(true); } }, []