improvement scroll to section & focus in create
Deploy app frontend / app frontend (push) Successful in 1m36s
Deploy app frontend / app frontend (push) Successful in 1m36s
This commit is contained in:
@@ -16,13 +16,14 @@ watch(
|
|||||||
() => sectionRef.value && props.isNextActiveSection,
|
() => sectionRef.value && props.isNextActiveSection,
|
||||||
(isNextActiveSection) => {
|
(isNextActiveSection) => {
|
||||||
if (isNextActiveSection) {
|
if (isNextActiveSection) {
|
||||||
sectionRef.value?.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
const isSM = window.matchMedia('(min-width: 640px)').matches
|
||||||
|
sectionRef.value?.scrollIntoView({ behavior: 'smooth', block: isSM ? 'center' : 'start' })
|
||||||
|
|
||||||
const input = sectionRef.value?.querySelector('input[type="text"]')
|
const input = sectionRef.value?.querySelector('input[type="text"][value=""]')
|
||||||
if (input instanceof HTMLInputElement) {
|
if (input instanceof HTMLInputElement) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
input.focus()
|
input.focus()
|
||||||
}, 200)
|
}, 400)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user