Close search bar after pressing enter

This commit is contained in:
jeffvli
2021-11-22 19:50:40 -08:00
committed by Jeff
parent 100c57621b
commit 1bb52a652e

View File

@@ -157,6 +157,8 @@ const Layout = ({ footer, children, disableSidebar, font }: any) => {
if (misc.searchQuery.trim()) {
history.push(`/search?query=${misc.searchQuery}`);
}
dispatch(setSearchQuery(''));
setOpenSearch(false);
}}
onKeyDown={(e: KeyboardEvent) => {
if (e.key === 'Escape') {