Skip to content

Commit c36a267

Browse files
committed
fix: handle direction assignment when moving node bf/aft main node
1 parent 38b2706 commit c36a267

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils/objectManipulation.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export function insertParentNodeObj(obj: NodeObj, newObj: NodeObj) {
5858

5959
export function moveNodeObj(type: 'in' | 'before' | 'after', from: NodeObj, to: NodeObj) {
6060
removeNodeObj(from)
61+
if (!to.parent?.parent) {
62+
from.direction = to.direction
63+
}
6164
if (type === 'in') {
6265
if (to.children) to.children.push(from)
6366
else to.children = [from]

0 commit comments

Comments
 (0)