diff --git a/frontend/src/pages/GuidePage/GuidePage.tsx b/frontend/src/pages/GuidePage/GuidePage.tsx index 2ddb6fa..f8cae6d 100644 --- a/frontend/src/pages/GuidePage/GuidePage.tsx +++ b/frontend/src/pages/GuidePage/GuidePage.tsx @@ -35,6 +35,25 @@ export const GuidePage = () => { navigate('/signup'); }, [navigate]); + // Scroll to hash target after lazy-loaded sections render + useEffect(() => { + const hash = window.location.hash.slice(1); + if (!hash) return; + + // Poll for the element since Suspense sections load asynchronously + let attempts = 0; + const interval = setInterval(() => { + const target = document.getElementById(hash); + if (target) { + clearInterval(interval); + target.scrollIntoView({ behavior: 'smooth' }); + } + if (++attempts >= 20) clearInterval(interval); + }, 100); + + return () => clearInterval(interval); + }, []); + // Track scroll position for nav background and active section useEffect(() => { const handleScroll = () => {