fix: cursor blinks when editing a new block

This commit is contained in:
Tienson Qin
2023-10-26 01:02:36 +08:00
parent ed13217ad5
commit 2212016a3b
2 changed files with 10 additions and 11 deletions

View File

@@ -369,10 +369,9 @@
:else
;; take the first dom node
(gdom/getElement (str "ls-block-" (:block/uuid block))))]
(state/set-editing! "" content block text-range {:ref next-edit-node})
(if next-edit-node
(do
(state/set-editing! "" content block text-range {:ref next-edit-node})
(mark-last-input-time! repo))
(mark-last-input-time! repo)
(util/schedule (fn [] (edit-block-aux repo block content block-node text-range (update opts :retry-times inc))))))))
(defn edit-block!