From 80d90bd894e1d88a7a3053735e6e201318934120 Mon Sep 17 00:00:00 2001 From: GarvitDadheech Date: Sun, 28 Jul 2024 00:46:32 +0530 Subject: [PATCH 1/2] update dropdown --- src/shared/components/query/StudySearch.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/shared/components/query/StudySearch.tsx b/src/shared/components/query/StudySearch.tsx index 56ade8f6044..5c9130eebdd 100644 --- a/src/shared/components/query/StudySearch.tsx +++ b/src/shared/components/query/StudySearch.tsx @@ -48,11 +48,7 @@ export const StudySearch: FunctionComponent = observer( const onKeyDownSearchBox = useCallback( (e: React.KeyboardEvent) => { - if ([13, 27].includes(e.keyCode)) { store.setMenuOpen(false); - } else { - store.setMenuOpen(true); - } }, [] ); From 3b6d3e7d500e362539c94c00b8da4bf66eded3c2 Mon Sep 17 00:00:00 2001 From: alisman Date: Fri, 10 Jan 2025 17:00:18 -0500 Subject: [PATCH 2/2] Close study search dropdown on keypress --- src/shared/components/query/StudySearch.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shared/components/query/StudySearch.tsx b/src/shared/components/query/StudySearch.tsx index 5c9130eebdd..438742ffe23 100644 --- a/src/shared/components/query/StudySearch.tsx +++ b/src/shared/components/query/StudySearch.tsx @@ -47,8 +47,11 @@ export const StudySearch: FunctionComponent = observer( }, []); const onKeyDownSearchBox = useCallback( - (e: React.KeyboardEvent) => { + async (e: React.KeyboardEvent) => { + if (store.isMenuOpen) { + await sleep(500); store.setMenuOpen(false); + } }, [] );