Skip to content

Pagination Does Not Scroll to Top on Page Change in Block Discover Page #51

@vaibhavgupta5

Description

@vaibhavgupta5

Description

Pagination on the Block Discover page is functioning correctly, but when navigating to the next page, the scroll position remains at the bottom of the page instead of automatically scrolling back to the top.

This creates a poor user experience because users land at the bottom of the newly loaded page and need to manually scroll up to view the content.

I will attach a before/after video demonstrating the issue and the fix.

Current Behavior

  • User scrolls down on the Block Discover page
  • Clicks on the next pagination button
  • New page loads
  • Scroll position remains at the bottom

Expected Behavior

  • When changing pagination pages, the page should automatically scroll to the top smoothly.

Fix

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

Before

oldtailark.1.mp4

After

newtailark.1.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions