Open filecc opened 1 day ago
I've been running into similar issues and discovered that the previous issues on this were closed, but a new version hasn't yet been released. The fixes for this are in the 1.3.0 beta versions (you can see the release notes that include these fixes here: https://github.com/inertiajs/inertia/releases/tag/v1.3.0-beta.1). A final 1.3.0 release is needed for these fixes to be present in the npm package.
Version:
@inertiajs/react
version: 1.2.0Describe the problem:
I have a div with a scrollable list: every element in that list is a button. Clicking the button trigger a get request to the server and the serve (for simplicity) redirect back to the view. I want the scroll position in the div to be preserved after the redirect back, but instead it's always reset to the top of the page.
Steps to reproduce:
method
component
route
Doesn't matter what I put in the
preserveScroll
parameter, every time scroll position get restored to the top of the page, while I would love the it stays where I clicked first. I already tried with the form helper, with the Link component, nothing works. Also, doing as per the documentationproduce a warning:
Removing the "overflow-y-auto" and letting the page go for itself do the tricks.. but it's not what I want and what is menta to be.
Any help would be VERY appreciated.
Thanks!