From 9009a75d24100a8557e178ce9cea1d8ab09af533 Mon Sep 17 00:00:00 2001 From: Ryderjj89 Date: Sun, 28 Sep 2025 16:56:02 -0400 Subject: [PATCH] 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! --- frontend/src/App.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 11ba6479..ce6787b9 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -44,8 +44,10 @@ function App() { setSelectedVersion(''); } - // Scroll to top when navigating to new pages - window.scrollTo(0, 0); + // 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(() => {