Scroll Restoration Behavior
6 min
overview our application automatically restores your previous scroll position when navigating between pages however, due to lazy loading of content, this restoration may not always appear smooth or accurate current behavior content at the bottom not loaded what happens when you navigate back to a page where you previously scrolled down the content at the bottom may not be loaded yet due to lazy loading the app will retry scrolling multiple times to reach your previous position you'll see the page "jump" several times as content loads and the page height increases why this happens your previous scroll position was further down the page than what's currently visible lazy loaded content needs time to load and expand the page height the app keeps trying to scroll to the exact position until the content is available content at the top not loaded what happens your scroll position is restored immediately when returning to a page additional content loads at the top of the page afterward this new content pushes existing content downward you end up at the wrong scroll position (too far down) controlling scroll restoration you can now control this behavior using the disablelazyscrollrestoration feature flag in your experience configuration configuration add this to your experience config json { "purple" { "features" { "disablelazyscrollrestoration" true } } } behavior options when enabled ( true ) ✅ no scroll jumps smooth experience ⚠️ restored position may not be exact best for users who prefer smooth scrolling over precise positioning when disabled ( false or not set) ⚠️ may see scroll jumps as content loads ✅ guarantees you end up at the correct final position best for users who need precise scroll position restoration recommendation choose based on your content and user experience priorities enable if you have heavy lazy loading and prefer smooth navigation keep disabled if precise scroll positioning is critical for your users