fix: block blinks when exits and start editing another

This commit is contained in:
Tienson Qin
2025-06-03 01:24:26 +08:00
parent a4bfa4477e
commit 903c1ea856
4 changed files with 5 additions and 4 deletions

View File

@@ -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))))

View File

@@ -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!

View File

@@ -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

View File

@@ -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))))))