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

cib88's avatar
Level 2

When submitting a form the page goes back to the top

I've just noticed on my project that when submitting forms using Inertia.post() my pages jump to the top.

I didn't realise at first as my registration form is at the top of my page, but I have another form further down and when submitted no matter if there are errors or it was successful the page starts at the top. As far as I'm aware the page isn't reloading, is it normal for this to happen?

My controller returns look something like this return Inertia('Home')

0 likes
3 replies
bretto36's avatar

Can also be simplified to

router.visit(url, { preserveScroll: 'errors' })

if you are just looking at errors

Please or to participate in this conversation.