diff --git a/deps/outliner/src/logseq/outliner/core.cljs b/deps/outliner/src/logseq/outliner/core.cljs index 22fbb9d3f..f63e0361b 100644 --- a/deps/outliner/src/logseq/outliner/core.cljs +++ b/deps/outliner/src/logseq/outliner/core.cljs @@ -724,11 +724,12 @@ (defn- move-to-original-position? [blocks target-block sibling? non-consecutive-blocks?] - (let [block (first blocks)] + (let [block (first blocks) + db (.-db target-block)] (and (not non-consecutive-blocks?) (if sibling? (= (:db/id (ldb/get-left-sibling block)) (:db/id target-block)) - (= (:db/id (:block/parent block)) (:db/id target-block)))))) + (= (ldb/get-first-child db (:db/id target-block)) (:db/id block)))))) (defn- move-block [conn block target-block sibling?]