Added auto-scroll-to-top on all page navigations - fixes mobile scrolling issue
- **Navigation auto-scroll**: window.scrollTo(0, 0) added to location.pathname useEffect - **Mobile UX fix**: No more manual scrolling back up after version selection - **Smooth navigation flow**: Every route change brings user to page top - **Better mobile experience**: Prevents getting stuck scrolled down on new pages - **Applies to all routes**: Home → Books → Chapters → Verses all auto-scroll to top Mobile users can now seamlessly navigate without manual scrolling between pages!
This commit is contained in:
@@ -43,6 +43,9 @@ function App() {
|
|||||||
// At root path, no version is selected
|
// At root path, no version is selected
|
||||||
setSelectedVersion('');
|
setSelectedVersion('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Scroll to top when navigating to new pages
|
||||||
|
window.scrollTo(0, 0);
|
||||||
}, [location.pathname]);
|
}, [location.pathname]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user