frontarm / navi

🧭 Declarative, asynchronous routing for React.
https://frontarm.com/navi/
MIT License
2.07k stars 71 forks source link

Preserve scroll position when going back/forward #197

Open ColemanGariety opened 3 years ago

ColemanGariety commented 3 years ago

Similar to #190.

When using the traditional forward/back buttons, the scroll position is preserved. If you scroll down, click a link, and then go back, you won't end up back at the top of the page.

Because it emulates the forward/back buttons, Navi should also preserve scroll position when going forward and back.

stnmonroe commented 3 years ago

Hey, I'm also in need of this fix before having to rip apart an app to make certain features work. @JacksonGariety did you ever find a workaround for this?