fix: move block up/down should re-focus the editor

This commit is contained in:
Tienson Qin
2021-09-28 14:29:51 +08:00
parent d67547a0b8
commit 117033ec20

View File

@@ -1790,7 +1790,10 @@
:data [block]}]
(db/refresh! repo opts)))
(when-let [block-node (util/get-first-block-by-id block-id)]
(.scrollIntoView block-node #js {:behavior "smooth" :block "nearest"}))))))
(.scrollIntoView block-node #js {:behavior "smooth" :block "nearest"})
(when-let [input-id (state/get-edit-input-id)]
(when-let [input (gdom/getElement input-id)]
(.focus input))))))))
;; selections
(defn on-tab