Fix editor key events bubbling up
This commit is contained in:
parent
6c1ee3a3fc
commit
9ce2169931
1 changed files with 5 additions and 8 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue