Skip to content

Fix pagination scroll behavior across website#52

Open
vaibhavgupta5 wants to merge 1 commit into
tailark:mainfrom
vaibhavgupta5:FIX/Pagination-Scroll
Open

Fix pagination scroll behavior across website#52
vaibhavgupta5 wants to merge 1 commit into
tailark:mainfrom
vaibhavgupta5:FIX/Pagination-Scroll

Conversation

@vaibhavgupta5
Copy link
Copy Markdown

Summary

This PR improves the pagination experience across the website by automatically scrolling to the top whenever users navigate between pages using the shared pagination component. Fixes #51

Previously, pagination changes preserved the current scroll position, causing users to land at the bottom or middle of the next page. This required manual scrolling and created an inconsistent browsing experience.

With this fix, all pagination transitions now smoothly scroll users back to the top of the page.

Changes Made

Added smooth scroll-to-top behavior inside the pagination page change handler:

const handlePageChange = (page: number) => {
    onPageChange(page)
    window.scrollTo({ top: 0, behavior: 'smooth' })
}

Before

  • Pagination navigation worked correctly
  • Scroll position persisted between page changes
  • Users often landed at the bottom of newly loaded pages

After

  • Pagination navigation still works correctly
  • Page automatically scrolls to the top after pagination changes
  • Consistent and improved UX across the website

Testing

  • Verified pagination behavior across multiple pages
  • Tested smooth scrolling functionality
  • Confirmed no impact on existing pagination logic

Demo

Before

oldtailark.1.mp4

After

newtailark.1.mp4

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 9, 2026

@vaibhavgupta5 is attempting to deploy a commit to the Tailark Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant