Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Fix] Fix page scroll position not resetting on navigation #2334

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

Michaeldremy
Copy link
Contributor

Closes #2330

Previously, when users navigated between certain pages from the Homepage, the scroll position was maintained from the previous page, causing users to start at a non-zero scroll position. This was particularly noticeable when users navigated from the bottom of a page.

Changes:

  • Implemented ScrollToTop component to reset scroll position on route changes
  • Maintains scroll position for hash links (#) while resetting for regular navigation
  • Provides consistent scrolling behavior across all routes

…entire application causing the user to be jumped to the top of the page regardless of where they were located on previous page.
@Michaeldremy Michaeldremy self-assigned this Nov 13, 2024
@Michaeldremy Michaeldremy linked an issue Nov 13, 2024 that may be closed by this pull request
@Michaeldremy Michaeldremy requested a review from ojbravo November 13, 2024 17:03
Copy link
Contributor

@ojbravo ojbravo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm!

@Michaeldremy Michaeldremy merged commit 073cd20 into master Nov 13, 2024
1 of 2 checks passed
@Michaeldremy Michaeldremy deleted the 2330-page-position-on-load branch November 13, 2024 20:10
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.

Update Page Position on Load
2 participants