fix(DeleteRunnerModal): ESC key

This commit is contained in:
Philipp Dormann 2023-04-12 19:22:52 +02:00
parent ebdd1c2c0c
commit 1df505ea00
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314

View File

@ -1,7 +1,7 @@
<script>
import { _ } from "svelte-i18n";
import { clickOutside } from "../base/outsideclick";
import { createEventDispatcher } from "svelte";
import { createEventDispatcher, onMount } from "svelte";
export let modal_open;
export let delete_runner = {
id: 0,
@ -9,8 +9,7 @@
lastname: "",
};
const dispatch = createEventDispatcher();
(() => {
onMount(() => {
document.onkeydown = (e) => {
e = e || window.event;
if (e.key === "Escape") {
@ -23,7 +22,7 @@
}
}
};
})();
});
async function submit() {
dispatch("delete", { id: delete_runner.id });
}