#6911 save on enter #207
|
@ -20,7 +20,14 @@ const state = useState();
|
|||
const currentUser = ref(state.getUser());
|
||||
const newNote = ref('');
|
||||
const vnPaginateRef = ref();
|
||||
|
||||
function handleKeyUp(event) {
|
||||
jsegarra marked this conversation as resolved
alexm
commented
Review
```
if (event.key === 'Enter') {
event.preventDefault();
if (!event.shiftKey) insert();
}
```
👀
1
|
||||
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
|
||||
alexm
commented
Cambiar traduccion Cambiar traduccion
jsegarra
commented
https://gitea.verdnatura.es/verdnatura/salix-front/commit/492e333d2fdb4aaa1d903f5b1f21d78e6641889f
|
||||
autofocus
|
||||
@keyup.enter.stop="insert"
|
||||
@keyup="handleKeyUp"
|
||||
clearable
|
||||
>
|
||||
<template #append>
|
||||
|
|
Loading…
Reference in New Issue