0
0
Fork 0

fix: handle VnNotes keyup

This commit is contained in:
Javier Segarra 2024-05-31 12:37:30 +02:00
parent 0450986025
commit 5139bba5a0
1 changed files with 9 additions and 2 deletions

View File

@ -20,7 +20,14 @@ const state = useState();
const currentUser = ref(state.getUser());
const newNote = ref('');
const vnPaginateRef = ref();
function handleKeyUp(event) {
if (event.key === 'Enter' && event.shiftKey) {
event.preventDefault();
} else if (event.key === 'Enter') {
insert();
event.preventDefault();
}
}
async function insert() {
const body = $props.body;
Object.assign(body, { text: newNote.value });
@ -48,7 +55,7 @@ async function insert() {
size="lg"
autogrow
autofocus
@keyup.enter.stop="insert"
@keyup="handleKeyUp"
clearable
>
<template #append>