Browse Source

fix(mobile): close left sidebar when search

leizhe 4 years ago
parent
commit
01d9c28899
2 changed files with 3 additions and 2 deletions
  1. 2 1
      src/main/frontend/components/header.cljs
  2. 1 1
      src/main/frontend/ui.css

+ 2 - 1
src/main/frontend/components/header.cljs

@@ -190,7 +190,8 @@
         (when current-repo ;; this is for the Search button
           (ui/with-shortcut :go/search "right"
             [:a.button#search-button
-             {:on-click #(state/pub-event! [:go/search])}
+             {:on-click #(do (state/set-left-sidebar-open! false)
+                             (state/pub-event! [:go/search]))}
              (ui/icon "search" {:style {:fontSize ui/icon-size}})]))]
 
        [:div.r.flex

+ 1 - 1
src/main/frontend/ui.css

@@ -133,7 +133,7 @@ html.is-native-andorid
 html.is-native-iphone
 {
     .ui__modal {
-        top: 15vh;
+        top: 22vh;
     }
 }