fix: enable autofocus
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-09-23 15:21:07 +02:00
parent e9e2caee85
commit b4b31c0c92
2 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,7 @@ const { validations } = useValidator();
const { t } = useI18n();
const requiredFieldRule = (val) => validations().required($attrs.required, val);
const vnInputDateRef = ref(null);
const dateFormat = 'DD/MM/YYYY';
const isPopupOpen = ref();
@ -91,6 +92,7 @@ const styleAttrs = computed(() => {
<template>
<div @mouseover="hover = true" @mouseleave="hover = false">
<QInput
ref="vnInputDateRef"
v-model="formattedDate"
class="vn-input-date"
:mask="mask"
@ -113,6 +115,7 @@ const styleAttrs = computed(() => {
!$attrs.disable
"
@click="
vnInputDateRef.focus();
model = null;
isPopupOpen = false;
"

View File

@ -16,6 +16,7 @@ const props = defineProps({
default: false,
},
});
const vnInputTimeRef = ref(null);
const initialDate = ref(model.value ?? Date.vnNew());
const { t } = useI18n();
const requiredFieldRule = (val) => validations().required($attrs.required, val);
@ -69,6 +70,7 @@ function dateToTime(newDate) {
<template>
<div @mouseover="hover = true" @mouseleave="hover = false">
<QInput
ref="vnInputTimeRef"
class="vn-input-time"
mask="##:##"
placeholder="--:--"
@ -92,6 +94,7 @@ function dateToTime(newDate) {
!$attrs.disable
"
@click="
vnInputTimeRef.focus();
model = null;
isPopupOpen = false;
"