fix(mobile): wrong cursor restore when indent or outdent

This commit is contained in:
leizhe
2021-12-20 23:47:19 +08:00
committed by Tienson Qin
parent 23c4f3e4c5
commit 925f764730
3 changed files with 8 additions and 2 deletions

View File

@@ -176,8 +176,11 @@
(when-let [node (gdom/getElement (str id))]
(when-let [cursor-range (state/get-cursor-range)]
(when-let [range cursor-range]
(let [pos (diff/find-position markup range)]
(cursor/move-cursor-to node pos))))))
(let [pos (:editor/pos @state/state)
pos (or pos (diff/find-position markup range))]
(cursor/move-cursor-to node pos)
(state/set-state! :editor/pos nil))))))
(defn highlight-block!
[block-uuid]