fix: scroll to follow the moving block

This commit is contained in:
Sebastian Bensusan
2021-06-13 12:45:46 -07:00
committed by Tienson Qin
parent 8a6cbc7fe9
commit 3be517a3ea

View File

@@ -1693,7 +1693,9 @@
(when-let [repo (state/get-current-repo)]
(let [opts {:key :block/change
:data [block]}]
(db/refresh! repo opts)))))))
(db/refresh! repo opts)))
(when-let [block-node (util/get-first-block-by-id block-id)]
(.scrollIntoView block-node #js {:behavior "smooth" :block "center"}))))))
;; selections
(defn on-tab