From 1644278fb17a554c279b9abcab250d38a9cba2a8 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Thu, 5 Mar 2026 02:19:27 -0500 Subject: [PATCH] fix: scroll to top on survey slide transitions and completion Co-Authored-By: Claude Opus 4.6 --- frontend/src/pages/SurveyPage.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/pages/SurveyPage.tsx b/frontend/src/pages/SurveyPage.tsx index 8ea3bea1..0a0e39bb 100644 --- a/frontend/src/pages/SurveyPage.tsx +++ b/frontend/src/pages/SurveyPage.tsx @@ -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 {