瀏覽代碼

fix(ios): button element inside button element

Andelf 2 年之前
父節點
當前提交
d63d5aa16d
共有 2 個文件被更改,包括 27 次插入32 次删除
  1. 11 16
      src/main/frontend/mobile/index.css
  2. 16 16
      src/main/frontend/mobile/mobile_bar.cljs

+ 11 - 16
src/main/frontend/mobile/index.css

@@ -79,22 +79,17 @@
 
   button {
     padding: 7px 10px;
+  }
 
-    .submenu {
-      background-color: red;
-      z-index: 100;
-      background-color: var(--ls-secondary-background-color);
-      border-radius: 5px;
-      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02);
-      overflow-x: overlay;
-      overflow-y: hidden;
-      left: 0px;
-      height: 40px;
-    }
-
-    .show-submenu {
-      display: block;
-    }
+  .submenu {
+    z-index: 100;
+    background-color: var(--ls-secondary-background-color);
+    overflow-x: overlay;
+    overflow-y: hidden;
+    height: 45px;
+  }
+  .show-submenu {
+    display: flex;
   }
 
   .toolbar-commands {
@@ -246,4 +241,4 @@ html.is-zoomed-native-ios {
       }
     }
   }
-}
+}

+ 16 - 16
src/main/frontend/mobile/mobile_bar.cljs

@@ -48,23 +48,23 @@
      [:button.bottom-action
       {:on-mouse-down (fn [event]
                         (util/stop event)
-                        (let [target (gdom/getNextElementSibling (.-target event))]
+                        (let [target (gdom/getNextElementSibling (gdom/getParentElement (.-target event)))]
                           (dom/add-class! target "show-submenu")))}
-      (ui/icon "calendar" {:size ui/icon-size})
-      [:div.submenu.fixed.hidden.flex.flex-col.w-full.justify-evenly
-       {:style {:bottom @util/keyboard-height}}
-       (command-cp #(let [today (page-handler/get-page-ref-text (date/today))]
-                      (commands/simple-insert! parent-id today {}))
-                   "Today")
-       (command-cp #(let [tomorrow (page-handler/get-page-ref-text (date/tomorrow))]
-                      (commands/simple-insert! parent-id tomorrow {}))
-                   "Tomorrow")
-       (command-cp #(let [yesterday (page-handler/get-page-ref-text (date/yesterday))]
-                      (commands/simple-insert! parent-id yesterday {}))
-                   "Yesterday")
-       (command-cp #(let [timestamp (date/get-current-time)]
-                      (commands/simple-insert! parent-id timestamp {}))
-                   "Time")]]]))
+      (ui/icon "calendar" {:size ui/icon-size})]
+     [:div.submenu.fixed.left-0.hidden.w-full.flex-row.justify-evenly.items-center
+      {:style {:bottom @util/keyboard-height}}
+      (command-cp #(let [today (page-handler/get-page-ref-text (date/today))]
+                     (commands/simple-insert! parent-id today {}))
+                  "Today")
+      (command-cp #(let [tomorrow (page-handler/get-page-ref-text (date/tomorrow))]
+                     (commands/simple-insert! parent-id tomorrow {}))
+                  "Tomorrow")
+      (command-cp #(let [yesterday (page-handler/get-page-ref-text (date/yesterday))]
+                     (commands/simple-insert! parent-id yesterday {}))
+                  "Yesterday")
+      (command-cp #(let [timestamp (date/get-current-time)]
+                     (commands/simple-insert! parent-id timestamp {}))
+                  "Time")]]))
 
 (defn commands
   [parent-id]