Bug: No scroll-to-top on route navigation #89
Labels
No Label
P0 Critical
P1 High
P2 Medium
P3 Low
accessibility
backend
bug
content
data-integrity
enhancement
frontend
infra
integration
owner
owner-input
performance
performance
phase-7
phase-8
security
seo
ui
ux
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Queue-North-Website#89
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When navigating between pages (e.g. from Services to Contact), the scroll position persists from the previous page. Users land mid-page instead of at the top.
This is a known SPA issue - React Router does not auto-scroll on route change.
Fix
Add a ScrollToTop component that calls window.scrollTo(0, 0) on every route change:
import { useEffect } from react;
import { useLocation } from react-router-dom;
export default function ScrollToTop() {
const { pathname } = useLocation();
useEffect(() => { window.scrollTo(0, 0); }, [pathname]);
return null;
}
Then add ScrollToTop inside the App component.
Files
Severity
Medium - affects all page transitions