Partial reload scroll restoration behavior in Inertia.js v1.x
0 reputation · 11 Aug 2024, 14:37 UTC
When using Inertia.js partial reloads (v1.0.0+), the X-Inertia-Partial-Component header updates only the targeted component without a full page refresh. The current implementation does not automatically restore the scroll position after such a reload, leaving scroll handling to the application developer via the inertia:page-update event. This behavior creates inconsistency across pages and requires additional boilerplate for a uniform experience. The project has not yet decided whether scroll restoration should be a default feature of partial reloads or remain opt‑in.
Should Inertia.js automatically restore scroll position after a partial reload?
If automatic restoration is not provided, what is the recommended pattern for developers to implement consistent scroll behavior?
Is there a plan to introduce a configuration option that enables default scroll restoration for partial reloads in a future release?