Browse Source

fix(mobile): press home button in the root tab doesn't scroll to top

Tienson Qin 3 weeks ago
parent
commit
b9928a150c
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/main/mobile/bottom_tabs.cljs

+ 4 - 3
src/main/mobile/bottom_tabs.cljs

@@ -120,9 +120,10 @@
            (not= @*current-tab tab)
            (do
              (reset! *current-tab tab)
-             (mobile-state/set-tab! tab)
-             (when (= "home" tab)
-               (util/scroll-to-top false))))))
+             (mobile-state/set-tab! tab))
+
+           (= @*current-tab tab "home")
+           (util/scroll-to-top false))))
 
       (add-watch mobile-state/*tab ::select-tab
                  (fn [_ _ _old new]