fix: scroll to top after survey slide transition renders
Use requestAnimationFrame to defer scrollTo until after React renders the new slide content, preventing the browser from staying at the bottom of the page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -188,7 +188,9 @@ export default function SurveyPage() {
|
||||
|
||||
const goSlide = (idx: number) => {
|
||||
setCurrentSlide(idx)
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
requestAnimationFrame(() => {
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
})
|
||||
}
|
||||
|
||||
const handleSubmit = async () => {
|
||||
|
||||
Reference in New Issue
Block a user