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) {
|
function onKeyPress(ev: KeyboardEvent) {
|
||||||
if (ev.key === "Escape") {
|
if (ev.key === "Escape") {
|
||||||
emit("close");
|
emit("close");
|
||||||
ev.preventDefault();
|
} else if (ev.key === "Enter" && !ev.shiftKey) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ev.key === "Enter" && !ev.shiftKey) {
|
|
||||||
emit("finish", text.value);
|
emit("finish", text.value);
|
||||||
ev.preventDefault();
|
} else return;
|
||||||
return;
|
|
||||||
}
|
ev.preventDefault();
|
||||||
|
ev.stopPropagation();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue