Close modal using escape

This commit is contained in:
Romein van Buren 2022-10-28 15:29:17 +02:00
parent 721d788a5c
commit a2a11c3bd2
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49

View File

@ -7,8 +7,16 @@
function close() {
open = false;
}
function keyup(event) {
if (event.key === 'Escape') {
close();
}
}
</script>
<svelte:window on:keyup={keyup} />
<div class="modal-bg theme-{$settings.theme}" class:open>
<div class="modal">
<div class="header">