From cc7f9d94bb95d5e90ae1b27e840871b6d25d4e0e Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sat, 20 May 2023 23:47:54 +0100 Subject: [PATCH] Clear text on command menu close --- src/components/CommandMenu/CommandMenu.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/CommandMenu/CommandMenu.tsx b/src/components/CommandMenu/CommandMenu.tsx index 638d577a8..76c06c828 100644 --- a/src/components/CommandMenu/CommandMenu.tsx +++ b/src/components/CommandMenu/CommandMenu.tsx @@ -58,6 +58,7 @@ export function CommandMenu() { }); useOutsideClick(modalRef, () => { + setSearchedText(''); setIsActive(false); }); @@ -147,6 +148,7 @@ export function CommandMenu() { } else if (e.key === 'Tab') { e.preventDefault(); } else if (e.key === 'Escape') { + setSearchedText(''); setIsActive(false); } else if (e.key === 'Enter') { const activePage = searchResults[activeCounter];