Scroll Resetting
When navigating between pages, Inertia mimics default browser behavior by automatically resetting the scroll position of the document body (as well as any scroll regions you’ve defined) back to the top. In addition, Inertia keeps track of the scroll position of each page and automatically restores that scroll position as you navigate forward and back in history.Scroll Preservation
Sometimes it’s desirable to prevent the default scroll resetting when making visits. You can disable this behavior by setting thepreserveScroll option to false.
preserveScroll option to “errors”.
preserveScroll option based on the response by providing a callback.
preserveScroll prop.
Scroll Regions
If your app doesn’t use document body scrolling, but instead has scrollable elements (using theoverflow CSS property), scroll resetting will not work.
In these situations, you must tell Inertia which scrollable elements to manage by adding the scroll-region attribute to the element.