Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

chore: clear search term on escape key (#4289)

Aaryan Khandelwalf87bb9523631
diff --git a/web/components/command-palette/command-modal.tsx b/web/components/command-palette/command-modal.tsx
index aa36eabed7..29734efc9d 100644
--- a/web/components/command-palette/command-modal.tsx
+++ b/web/components/command-palette/command-modal.tsx
@@ -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();