1
0
Эх сурвалжийг харах

fix: block blinks when exits and start editing another

Tienson Qin 5 сар өмнө
parent
commit
903c1ea856

+ 0 - 1
src/main/frontend/components/block.cljs

@@ -2581,7 +2581,6 @@
 
 (defn- block-content-on-pointer-down
   [e block block-id content edit-input-id config]
-  (util/mobile-keep-keyboard-open)
   (when-not (or
              (:closed-values? config)
              (> (count content) (state/block-content-max-length (state/get-current-repo))))

+ 2 - 0
src/main/frontend/components/editor.cljs

@@ -752,6 +752,8 @@
       ;; exit editing mode
       :else
       (let [select? (= type :esc)]
+        (when (.closest (.-target e) ".block-content")
+          (util/mobile-keep-keyboard-open))
         (when-let [container (gdom/getElement "app-container")]
           (dom/remove-class! container "blocks-selection-mode"))
         (p/do!

+ 1 - 1
src/main/frontend/components/page.cljs

@@ -136,7 +136,7 @@
      [:div.flex.flex-row
       [:div.flex.items-center {:style {:height 28
                                        :margin-left (if (util/mobile?) 0 22)}}
-       [:span.bullet-container.cursor.opacity-0.transition-opacity.ease-in.duration-100 {:ref *bullet-ref}
+       [:span.bullet-container.cursor.opacity-0.transition-opacity.ease-in.duration-100
         [:span.bullet]]]]]))
 
 (rum/defcs page-blocks-cp < rum/reactive db-mixins/query

+ 2 - 2
src/main/frontend/util.cljc

@@ -1545,5 +1545,5 @@ Arg *stop: atom, reset to true to stop the loop"
    (defn mobile-keep-keyboard-open
      []
      (when mobile?
-       (when-let [node (gdom/getElement "app-keep-keyboard-open-input")]
-         (.focus node)))))
+       (schedule #(when-let [node (gdom/getElement "app-keep-keyboard-open-input")]
+                    (.focus node))))))