Skip to content

fix(scroll): Maintain scroll position while navigating through pages #1810

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mackhack0705
Copy link

###Title

  • fix(scroll): Maintain scroll position while navigating through pages

Description

  • Saves scroll position to sessionStorage on route change in 'saveScrollPosition' function
  • Save scroll position as per the current path url
  • Restores position on come from the route in 'useEffect'
  • Adds cleanup for sessionStorage

Related Issue

Fixes #1735

Testing

  • Tested navigation between pages in Chrome
  • Verified that scroll position is preserved after back/forward navigation

Save scroll position to sessionStorage on routeChangeStart, Restore position on routeChangeComplete, Add cleanup for sessionStorage after restoration
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.

feature: Maintain scroll position while navigating through pages
1 participant