Smart scroll-to-top preserves verse auto-navigation

- **Conditional scroll-to-top**: Only scroll to top when no verse hash is present
- **Preserves verse navigation**: Verse favorites and search results auto-scroll to verses
- **Mobile-friendly**: Version selections still scroll to top on book pages
- **No breaking changes**: All existing auto-navigation features remain intact

Mobile scrolling now works perfectly without breaking verse deep-linking!
This commit is contained in:
Ryderjj89
2025-09-28 16:56:02 -04:00
parent d05b5fb20a
commit 9009a75d24

View File

@@ -44,8 +44,10 @@ function App() {
setSelectedVersion('');
}
// Scroll to top when navigating to new pages
// Scroll to top when navigating to new pages (unless there's verse auto-navigation active)
if (!window.location.hash.startsWith('#verse-')) {
window.scrollTo(0, 0);
}
}, [location.pathname]);
useEffect(() => {