From 24348c62ae5d5bcf39918db2b6d6295663ba5333 Mon Sep 17 00:00:00 2001 From: graceful-tech12 Date: Mon, 31 Aug 2026 12:14:10 +0000 Subject: [PATCH] fix: reset scroll to top on bookings page change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a goToPage helper that sets the page state and calls window.scrollTo(0, 0) so the user sees the top of the list after navigating to the previous or next page. Fixes #344 🤖 Generated with Codebuff Co-Authored-By: Codebuff --- frontend/app/bookings/page.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/app/bookings/page.tsx b/frontend/app/bookings/page.tsx index 39d7cb6..97ce34a 100644 --- a/frontend/app/bookings/page.tsx +++ b/frontend/app/bookings/page.tsx @@ -188,6 +188,11 @@ export default function MyBookingsPage() { const bookings = data?.data ?? []; const meta = data?.meta; + function goToPage(nextPage: number) { + setPage(nextPage); + window.scrollTo({ top: 0, behavior: "instant" }); + } + return (
@@ -267,16 +272,14 @@ export default function MyBookingsPage() {