Fix editor key events bubbling up

This commit is contained in:
Joscha 2025-02-07 22:16:06 +01:00
parent 6c1ee3a3fc
commit 9ce2169931

View file

@ -29,15 +29,12 @@ function onInput() {
function onKeyPress(ev: KeyboardEvent) {
if (ev.key === "Escape") {
emit("close");
ev.preventDefault();
return;
}
if (ev.key === "Enter" && !ev.shiftKey) {
} else if (ev.key === "Enter" && !ev.shiftKey) {
emit("finish", text.value);
ev.preventDefault();
return;
}
} else return;
ev.preventDefault();
ev.stopPropagation();
}
</script>