handle date enter

This commit is contained in:
Pete Matsyburka
2024-08-01 18:47:17 +03:00
parent 3a2910f717
commit 0bd35b526c
2 changed files with 10 additions and 1 deletions
+9 -1
View File
@@ -43,6 +43,7 @@
:required="field.required"
type="date"
:name="`values[${field.uuid}]`"
@keydown.enter="onEnter"
@focus="$emit('focus')"
>
</div>
@@ -78,7 +79,7 @@ export default {
default: ''
}
},
emits: ['update:model-value', 'focus'],
emits: ['update:model-value', 'focus', 'submit'],
computed: {
value: {
set (value) {
@@ -90,6 +91,13 @@ export default {
}
},
methods: {
onEnter (e) {
if (this.modelValue) {
e.preventDefault()
this.$emit('submit')
}
},
setCurrentDate () {
const inputEl = this.$refs.input
+1
View File
@@ -106,6 +106,7 @@
v-model="values[currentField.uuid]"
:show-field-names="showFieldNames"
:field="currentField"
@submit="submitStep"
@focus="scrollIntoField(currentField)"
/>
<div v-else-if="currentField.type === 'select'">