fix: preserve the scroll position when navigating pages

This commit is contained in:
Tienson Qin
2022-05-28 02:12:42 +08:00
parent 062c2523bc
commit e649650d28
2 changed files with 5 additions and 4 deletions

View File

@@ -148,6 +148,7 @@
(when @*scroll-timer
(js/clearTimeout @*scroll-timer))
(state/set-state! :ui/scrolling? true)
(state/save-scroll-position! (util/scroll-top))
(reset! *scroll-timer (js/setTimeout
(fn [] (state/set-state! :ui/scrolling? false)) 500)))
false)))