Closed buckfuddey closed 5 months ago
Hey there,
Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out.
Thanks!
Version:
@inertiajs/vue3
version: ^0.6.8Describe the problem:
So to preface this, I'm rather new to front-end frameworks overall and might just be crying wolf. However, I can't for the life of me find a line of documentation or reference in a forum that states whether preserveScroll is supposed to work without preserveState.
My issues is that I have a file component which does this:
If I set preserveScroll: true, preserveState seems to default to true, as my refs retain their pre-submit value and my form is not reset.
If I set preserveScroll: true, preserveState: false, the page reloads and jumps to the top after the request is successful.
I have opted to set a
To mitigate loosing valuable feedback from the backend on failure or success. However this leaves the form feeling clunky as it jumps abruptly, looking kind of glitchy. I'm also worried that users who have slow internet may enter a state where the component is not rendered in time, because without it, Inertia does not know of the element it is supposed to scroll to.
Can someone please let me know if this is expected behavior?
Steps to reproduce:
I'll include my current fix, which also depends on a CreateFile component, the first code block is the CreateFile which only emits, the second is the Component I'm struggling with. Throw these components together, maybe exclude heroicons if its too much hassle to download, as well as the updatesuccess and input error components might cause hassle.
Include the second component in a page you want to try this in and point it to a route that expects a file.