From d09c87a5a50ef3167d480f46b6d349b41629c4a7 Mon Sep 17 00:00:00 2001 From: Michilis Date: Fri, 5 Jun 2026 02:52:14 +0000 Subject: [PATCH] Fix booking flow scroll position on mobile step changes. Scroll to the top whenever the booking step changes so users are not left at the bottom of the page after submitting the form. --- frontend/src/app/(public)/book/[eventId]/page.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/app/(public)/book/[eventId]/page.tsx b/frontend/src/app/(public)/book/[eventId]/page.tsx index 9204ea8..5cc5740 100644 --- a/frontend/src/app/(public)/book/[eventId]/page.tsx +++ b/frontend/src/app/(public)/book/[eventId]/page.tsx @@ -228,6 +228,12 @@ export default function BookingPage() { } }, [agreedToTerms, termsError]); + // Scroll to top when moving between booking steps (esp. mobile, where + // the submit button sits at the bottom of a long form) + useEffect(() => { + window.scrollTo({ top: 0, behavior: 'smooth' }); + }, [step]); + const formatDate = (dateStr: string) => formatDateLong(dateStr, locale as 'en' | 'es'); const fmtTime = (dateStr: string) => formatTime(dateStr, locale as 'en' | 'es');