Escape key closes TaskPanel #15

Merged
vasek merged 1 commit from exyi/esc-close into master 2024-12-29 18:24:55 +01:00

View file

@ -37,6 +37,12 @@ import TaskDisplay from "./TaskDisplay.svelte";
behavior: 'smooth'
}), 100)
}
function handleKeydown(e: KeyboardEvent) {
if (e.key === "Escape") {
close()
}
}
</script>
<style>
@ -68,6 +74,8 @@ import TaskDisplay from "./TaskDisplay.svelte";
.panel.full .closeButton { display: inherit }
</style>
<svelte:window on:keydown={handleKeydown} />
<div class="panel {heightClass}"
on:click={() => selectedTask && select(selectedTask)}>
<TaskDisplay taskId={selectedTask?.id} />