fix: scroll to top on survey slide transitions and completion
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -199,12 +199,14 @@ export default function SurveyPage() {
|
||||
if (!res.ok) {
|
||||
if (res.status === 409) {
|
||||
setAlreadyCompleted(true)
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
return
|
||||
}
|
||||
const errData = await res.json().catch(() => null)
|
||||
throw new Error(errData?.detail || `Submission failed (${res.status})`)
|
||||
}
|
||||
setIsComplete(true)
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
} catch (err) {
|
||||
setSubmitError(err instanceof Error ? err.message : 'Submission failed. Try copying your responses instead.')
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user