feat: prevent default with enter
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Jon Elias 2025-04-09 12:06:22 +02:00
parent f3de8ecb73
commit bc6ce826ce
1 changed files with 5 additions and 3 deletions

View File

@ -38,7 +38,9 @@ function handleDelete(row) {
ticketNotesCrudRef.value.remove([row]); ticketNotesCrudRef.value.remove([row]);
} }
async function handleSave() { async function handleSave(e) {
if (e.shiftKey && e.key === 'Enter') return;
e.preventDefault();
if (!isSaving.value) { if (!isSaving.value) {
isSaving.value = true; isSaving.value = true;
await ticketNotesCrudRef.value?.saveChanges(); await ticketNotesCrudRef.value?.saveChanges();
@ -70,7 +72,7 @@ async function handleSave() {
<div <div
v-for="(row, index) in rows" v-for="(row, index) in rows"
:key="index" :key="index"
class="q-mb-md row items-center q-gutter-x-md" class="q-mb-md row q-gutter-x-md"
> >
<VnSelect <VnSelect
:label="t('ticketNotes.observationType')" :label="t('ticketNotes.observationType')"
@ -86,7 +88,7 @@ async function handleSave() {
:label="t('basicData.description')" :label="t('basicData.description')"
v-model="row.description" v-model="row.description"
class="col" class="col"
@keyup.enter="handleSave" @keydown.enter.stop="handleSave"
autogrow autogrow
data-cy="ticketNotesDescription" data-cy="ticketNotesDescription"
/> />