Sfoglia il codice sorgente

fix: can't drag block to a page's first child

Tienson Qin 1 anno fa
parent
commit
cd2b295004
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      src/main/frontend/handler/dnd.cljs

+ 4 - 2
src/main/frontend/handler/dnd.cljs

@@ -52,8 +52,10 @@
              (if first-child?
                (when-let [parent (:block/parent target-block)]
                  (outliner-op/move-blocks! blocks' parent false))
-               (when-let [before-node (ldb/get-left-sibling target-block)]
-                 (outliner-op/move-blocks! blocks' before-node true))))
+               (if-let [before-node (ldb/get-left-sibling target-block)]
+                 (outliner-op/move-blocks! blocks' before-node true)
+                 (when-let [parent (:block/parent target-block)]
+                   (outliner-op/move-blocks! blocks' parent false)))))
            (outliner-op/move-blocks! blocks' target-block (not nested?)))))
 
       :else