ng2-tree icon indicating copy to clipboard operation
ng2-tree copied to clipboard

When moving, NodeMoved event fails when the source node and the destination node are siblings

Open glueornose opened this issue 6 years ago • 3 comments

Drag-and-drop feature works well with all combinations with one exception: when the source node and the destination node are siblings. When the nodes are siblings, and one is moved to another, the NodeMovedEvent object, provided by nodeMoved event, contains wrong previousParent, because in this case both previousParent and node.parent contain the same object. As far as I understand, these two objects should never hold the same value, because you should not be able to move a node to its parent where it already is.

glueornose avatar Feb 19 '18 13:02 glueornose

@glueornose But do you get an exception somewhere? Actually this behavior is correct, cause the node was moved, though the new parent and the prev parent are still the same

rychkog avatar Mar 26 '18 07:03 rychkog

There are no exceptions, but at the moment it is not possible to move sibling nodes into each other.

glueornose avatar Mar 26 '18 08:03 glueornose

Any idea as to when this is going to be fixed? NodeMovedEvent still has no data about the node that's being moved.

glueornose avatar Dec 31 '18 13:12 glueornose