From e9e2caee85b0f1826b9a73d295800ed35efef463 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 23 Sep 2024 13:18:14 +0000 Subject: [PATCH 1/2] feat: autofocus after clear --- src/components/common/VnInput.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index 26160929c..1246eedcd 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -103,6 +103,7 @@ const mixinRules = [ @click=" () => { value = null; + vnInputRef.focus(); emit('remove'); } " From b4b31c0c92227c697d0bb5550773d51d0f3082ca Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 23 Sep 2024 15:21:07 +0200 Subject: [PATCH 2/2] fix: enable autofocus --- src/components/common/VnInputDate.vue | 3 +++ src/components/common/VnInputTime.vue | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/components/common/VnInputDate.vue b/src/components/common/VnInputDate.vue index fd8993d6f..3d5afaf80 100644 --- a/src/components/common/VnInputDate.vue +++ b/src/components/common/VnInputDate.vue @@ -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(() => {