From d242dcc028d6784ab0317b9ff8a9b10e503aed1a Mon Sep 17 00:00:00 2001 From: exyi Date: Tue, 29 Sep 2020 11:33:02 +0000 Subject: [PATCH] Escape key closes TaskPanel --- frontend/src/TaskPanel.svelte | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/TaskPanel.svelte b/frontend/src/TaskPanel.svelte index b96149a..8ff7689 100644 --- a/frontend/src/TaskPanel.svelte +++ b/frontend/src/TaskPanel.svelte @@ -37,6 +37,12 @@ import TaskDisplay from "./TaskDisplay.svelte"; behavior: 'smooth' }), 100) } + + function handleKeydown(e: KeyboardEvent) { + if (e.key === "Escape") { + close() + } + } + +
selectedTask && select(selectedTask)}>