fix: object blocks drag drop

pull/10438/head
Tienson Qin 2023-08-24 18:20:54 +08:00
parent e733a104bf
commit 517a476a9f
2 changed files with 9 additions and 1 deletions

View File

@ -1669,7 +1669,13 @@
(defn- bullet-drag-start
[event block uuid block-id]
(editor-handler/highlight-block! uuid)
(let [selected (set (map #(.-id %) (state/get-selection-blocks)))
selected? (contains? selected block-id)]
(when-not selected?
(util/clear-selection!)
(state/conj-selection-block! (gdom/getElement block-id) :down)
(editor-handler/highlight-block! uuid)))
(editor-handler/block->data-transfer! uuid event)
(.setData (gobj/get event "dataTransfer")
"block-dom-id"

View File

@ -163,6 +163,8 @@
(concat txs
[(assoc page-m :block/tags (:block/tags m))
{:db/id (:db/id block-entity)
:block/content ""
:block/refs []
:block/link [:block/uuid (:block/uuid page-m)]}]
merge-tx)))))))