mirror of
https://github.com/makeplane/plane.git
synced 2025-12-25 16:19:43 +01:00
chore: clear search term on escape key (#4289)
This commit is contained in:
committed by
GitHub
parent
f2fa6452c9
commit
f87bb95236
@@ -178,7 +178,9 @@ export const CommandModal: React.FC = observer(() => {
|
||||
return 0;
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
// when search is empty and page is undefined
|
||||
// when search term is not empty, esc should clear the search term
|
||||
if (e.key === "Escape" && searchTerm) setSearchTerm("");
|
||||
|
||||
// when user tries to close the modal with esc
|
||||
if (e.key === "Escape" && !page && !searchTerm) closePalette();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user