fix: editor cursor missing when moving across blocks

This commit is contained in:
Tienson Qin
2024-04-09 13:24:19 +08:00
parent ef627c245e
commit 8de498955f
6 changed files with 41 additions and 35 deletions

View File

@@ -174,8 +174,9 @@
[repo block content text-range {:keys [container-id]}]
(when block
(state/clear-edit!)
(state/set-editing! "" content block text-range {:container-id (or container-id @(:editor/container-id @state/state))})
(js/setTimeout #(state/update-tx-after-cursor-state!) 80)
(let [container-id (or container-id
@(:editor/container-id @state/state))]
(state/set-editing! "" content block text-range {:container-id container-id}))
(mark-last-input-time! repo)))
(defn sanity-block-content
@@ -186,7 +187,7 @@
(drawer/remove-logbook))))
(defn edit-block!
[block pos & {:keys [custom-content tail-len]
[block pos & {:keys [_container-id custom-content tail-len]
:or {tail-len 0}
:as opts}]
(when-not config/publishing?