diff --git a/presenter/src/components/forms/NewsletterForm.vue b/presenter/src/components/forms/NewsletterForm.vue index 4eaddb717b..2b40981659 100644 --- a/presenter/src/components/forms/NewsletterForm.vue +++ b/presenter/src/components/forms/NewsletterForm.vue @@ -98,11 +98,18 @@ const showInfoTime: number = 5000 const form = ref() const inputFieldNewsletter = ref() +const focusInput = () => { + if (inputFieldNewsletter.value) { + inputFieldNewsletter.value.focusInput() + } +} + const { mutate: sendSubscribeToNewsletter } = useMutation(subscribeToNewsletter) defineExpose({ form, inputFieldNewsletter, + focusInput, }) // submit form with data async function submitForm() { diff --git a/presenter/src/components/inputs/NameInput.vue b/presenter/src/components/inputs/NameInput.vue index df2dec167a..a794e2c967 100644 --- a/presenter/src/components/inputs/NameInput.vue +++ b/presenter/src/components/inputs/NameInput.vue @@ -1,5 +1,6 @@ diff --git a/presenter/src/pages/index/+Page.vue b/presenter/src/pages/index/+Page.vue index 35f980624e..9e02cea9c4 100644 --- a/presenter/src/pages/index/+Page.vue +++ b/presenter/src/pages/index/+Page.vue @@ -12,8 +12,8 @@
-
- +
+
@@ -37,9 +37,15 @@ import PlanningSection from '#root/src/components/sections/PlanningSection.vue' import ProductsSection from '#root/src/components/sections/ProductsSection.vue' const anchorNewsletter = ref() +const focusInput = () => { + if (anchorNewsletter.value) { + anchorNewsletter.value.focusInput() + } +} defineExpose({ anchorNewsletter, + focusInput, })