vikejs / vike

🔨 Flexible, lean, community-driven, dependable, fast Vite-based frontend framework.
https://vike.dev
MIT License
4.38k stars 350 forks source link

`keepScrollPosition` between any arbitrary group of pages #1854

Closed brillout closed 1 month ago

brillout commented 2 months ago

Description

By setting keepScrollPosition to a string you can preserve the scroll position between any arbitrary group of pages: if two pages have the same keepScrollPosition value then the scroll is preserved. Essentially, the keepScrollPosition values determine the "scroll preservation groups". The scroll position is preserved if and only if two pages belong to the same group.

It's already implemented but it's considered an experimental feature which may be removed at anytime. If you are using this, then write a comment down below explaining why you need this, we'll then make it a stable feature.

If no one adds a comment, then this feature will be removed.