mirror of https://github.com/logseq/logseq
fix: restore the editing cursor after saving a block
parent
1dfd7958d4
commit
1b20c3e214
|
@ -1353,7 +1353,11 @@
|
||||||
(when (and block value db-content-without-heading
|
(when (and block value db-content-without-heading
|
||||||
(not= (string/trim db-content-without-heading)
|
(not= (string/trim db-content-without-heading)
|
||||||
(string/trim value)))
|
(string/trim value)))
|
||||||
(save-block-aux! block value (:block/format block)))))))
|
(let [cur-pos (util/get-input-pos elem)]
|
||||||
|
(save-block-aux! block value (:block/format block))
|
||||||
|
;; Restore the cursor after saving the block
|
||||||
|
(when (and elem cur-pos)
|
||||||
|
(util/set-caret-pos! elem cur-pos))))))))
|
||||||
|
|
||||||
(defn on-up-down
|
(defn on-up-down
|
||||||
[state e up?]
|
[state e up?]
|
||||||
|
|
Loading…
Reference in New Issue