fix sections
Main daploy / deploy (push) Successful in 45s

This commit is contained in:
2024-11-20 09:48:18 +02:00
parent 99ff4beba3
commit fc66b779ae
2 changed files with 36 additions and 16 deletions
+5 -5
View File
@@ -7,16 +7,16 @@
<script setup lang="ts">
import { watch, useTemplateRef } from 'vue'
const props = defineProps<{ isActive: boolean }>()
const props = defineProps<{ isActive: boolean; isNextActiveSection: boolean }>()
const sectionRef = useTemplateRef('section')
// плавная прокрутка при активации секции
watch(
() => props.isActive,
(isActive) => {
if (isActive) {
sectionRef.value?.querySelector('input')?.focus()
() => props.isNextActiveSection,
(isNextActiveSection) => {
if (isNextActiveSection) {
sectionRef.value?.querySelector('input[type="text"]')?.focus()
sectionRef.value?.scrollIntoView({ behavior: 'smooth' })
}
},