From ebe4136c0a6d51896d88e27ae1db6e84f9538c42 Mon Sep 17 00:00:00 2001 From: volar Date: Thu, 19 Dec 2024 18:24:39 +0100 Subject: [PATCH] expose focus on AFormTextarea and AFormTextField --- src/components/form/AFormTextField.vue | 8 ++++++++ src/components/form/AFormTextarea.vue | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/components/form/AFormTextField.vue b/src/components/form/AFormTextField.vue index c96c9111..e60706de 100644 --- a/src/components/form/AFormTextField.vue +++ b/src/components/form/AFormTextField.vue @@ -144,6 +144,14 @@ const disabledComputed = computed(() => { if (isDefined(props.disabled)) return props.disabled return !!lockedByUserLocal.value }) + +const focus = () => { + textFieldRef.value?.focus() +} + +defineExpose({ + focus, +})