Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

charles15531's avatar

Preserve scroll when switching between views in inertiajs

How do i preserve scroll position when navigating between views with inertia? i tried adding the "preserve-scroll" attribute, but it didn't work. Seems to me: the "preserve-scroll" attribute is only works when revisiting same url

0 likes
1 reply
undeportedmexican's avatar

I don't think it works like that. If you're changing to a different view, where is the scroll supposed to remain? The contents of the website are unequivocally different. Maintaining scroll position wouldn't even make sense imo.

1 like

Please or to participate in this conversation.