From 9194e5ba51c4c947fc8b18cdbc36d977f936ac1b Mon Sep 17 00:00:00 2001 From: vaibhavgupta5 Date: Sat, 9 May 2026 15:57:48 +0530 Subject: [PATCH] fix: scroll to top on pagination page change --- apps/www/app/(discover)/components/pagination.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/www/app/(discover)/components/pagination.tsx b/apps/www/app/(discover)/components/pagination.tsx index d412dac..1917f53 100644 --- a/apps/www/app/(discover)/components/pagination.tsx +++ b/apps/www/app/(discover)/components/pagination.tsx @@ -49,6 +49,11 @@ export function Pagination({ currentPage, totalPages, onPageChange, itemsPerPage return pages } + const handlePageChange = (page: number) => { + onPageChange(page) + window.scrollTo({ top: 0, behavior: 'smooth' }) + } + const startItem = (currentPage - 1) * itemsPerPage + 1 const endItem = Math.min(currentPage * itemsPerPage, totalItems) @@ -77,7 +82,7 @@ export function Pagination({ currentPage, totalPages, onPageChange, itemsPerPage {totalPages > 1 && (