I think you can use the preserveScrollattribute on your Link component, or eventually check the Scroll regions section.
See the documentation for more details: https://inertiajs.com/scroll-management
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a page that contains a slideshow using Swiper and because for a slideshow to work as it should, it applies overflow of hidden to the div. When I use Link component of Inertia in the same page and click on the link, it causes the page scroll to be preserved. I mean when I come to the bottom of the page and click on a link, when it goes to another page, it won't go to the top of the page.
I used this code to fix the issue:
router.on('finish', () => {
window.scrollTo(0, 1);
});
Is there a better way to fix this issue?
Please or to participate in this conversation.