Added fix: reset scroll position on route navigation#744
Conversation
✅ Deploy Preview for github-spy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Review limit reached
More reviews will be available in 50 minutes and 15 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new ScrollToTop on navigation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🎉 Thank you @BLOSSOM206 for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines
|
This PR is ready for review. I've addressed the assigned issue, tested the changes locally, and all checks are passing. Whenever you have time, I'd appreciate your review. Thank you! |
Related Issue
Description
This PR fixes the issue where footer navigation links could retain the previous scroll position when navigating between routes.
A reusable
ScrollToTopcomponent was added to ensure that users are automatically taken to the top of the page whenever the route changes.Changes Made
ScrollToTopcomponent usinguseLocationanduseEffect.window.scrollTo(0, 0).How Has This Been Tested?
Reproduced the issue locally before implementing the fix.
Verified that the following pages now load from the top after navigation:
Tested navigation through footer links.
Tested on desktop browser.
Tested using mobile device emulation in browser developer tools.
Confirmed the application builds and runs successfully using
npm run dev.Demonstration
Issue reproduction before the fix.
Recording.2026-06-16.031945.1.mp4
Correct scroll behavior after the fix.
github_trcker.1.mp4
Type of Change
Summary by CodeRabbit