You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
<mainclassName="h-dvh overflow-y-hidden"><divscroll-region={"true"}className="overflow-y-auto"><buttononClick={submit}>Notification</button>{/* ...a very looong list*/}</div></main>
route
publicfunctionnotification_mark($id)
{
/* various operations */returnto_route('account.notifications');
}
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 documentation
<divclass="overflow-y-auto" scroll-region><!-- Your page content --></div>
produce a warning:
Warning: Received `true` for a non-boolean attribute `scroll-region`.
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!
The text was updated successfully, but these errors were encountered:
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 documentation
produce 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!
The text was updated successfully, but these errors were encountered: