Skip to content

Commit

Permalink
Scroll form to top on next slide
Browse files Browse the repository at this point in the history
  • Loading branch information
wpf500 committed Nov 14, 2024
1 parent d2a4a2c commit 2fdf5c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/frontend/src/components/pages/callouts/CalloutForm.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<form :class="formClass" @submit.prevent>
<form ref="formEl" :class="formClass" @submit.prevent>
<FormRenderer
v-for="slide in visibleSlides"
:key="slide.id"
Expand Down Expand Up @@ -104,6 +104,7 @@ const captchaToken = ref('');
const formError = ref('');
const isLoading = ref(false);
const formEl = ref<HTMLFormElement>();
const formClass = computed(() => [
'callout-form',
{
Expand Down Expand Up @@ -216,6 +217,8 @@ function handleNextSlide() {
}
slideIds.value.unshift(nextSlideId);
formEl.value?.scrollIntoView();
}
function handlePrevSlide() {
Expand Down

0 comments on commit 2fdf5c2

Please sign in to comment.