redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.3k stars 992 forks source link

[RFC]: Add an option to not reset the scroll position on navigate #10703

Open MartinDawson opened 5 months ago

MartinDawson commented 5 months ago

Summary

See this issue for more detail: https://github.com/petyosi/react-virtuoso/issues/1014#issuecomment-2140605254

This commit did this: https://github.com/redwoodjs/redwood/pull/1817/files#diff-db921824ed181576fb3274c4f842c348ce40bdb27d103d99dfd7357e97e345c9R97

Motivation

When using pagination in infinite scroll, you want to sync it with the urlParams and use that as the source of truth. However I can't use redwoodjs navigate for this because it internally resets the scroll position on every navigiate. There should be an option to disable it.

Detailed proposal

Add an option to navigate() to not have the scroll reset.

Are you interested in working on this?

Tobbe commented 5 months ago

Thanks for the suggestion @MartinDawson 🙂 Unfortunately this will get a pretty low priority right now unless you want to try to implement it yourself. Have you had a look at the navigate() function to see if you could add the functionality you need?