-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
discussionThis problem still needs more feedbackThis problem still needs more feedbackenhancementNew feature or requestNew feature or request
Description
Controlling what scroll position is saved
RFC at vuejs/rfcs#38 is not flexible enough: what about named views, what about scrolling multiple elements in the page.
A better option could be customising the computation of the scrollPosition saved in the history state as well as the restoration of that given scrollPosition. This would be a replacement for current scrollBehavior option and maybe we could internally refactor ours to do that
Another possibility is to move this to an official plugin similar to https://github.com/antfu/vue-router-better-scroller
Other things to take into account:
- Allow to manually save the scroll position (Version 4.6.0: Scroll to the top when reloading instead of maintaining the scroll position #2589). Useful to save the position after scrolling so reloading will see the correct position. This avoids using
beforeunloadevent, which is crucial. - It should be possible to save the scroll position without a native state (abstract history needs state?)
Metadata
Metadata
Assignees
Labels
discussionThis problem still needs more feedbackThis problem still needs more feedbackenhancementNew feature or requestNew feature or request
Type
Projects
Status
💬 In discussion