Hi Geoff
Please refer to the following sample for how to find the child under the mouse pointer when drop event triggered. In the sample we have added code to iterate the node collection and took the mouse position form the position argument of the drop event and check whether any node under the point using the containsPoint API and add another validation to the found nodes under the point is not the selected node and not the parent node. We have added change in the shared sample and added below for your references.
Code snippet:
public drop(e: IDropEventArgs) {
console.log('droped parent', e.target.id);
var node = this.diagram.nodes.filter(
node =>
node.wrapper.outerBounds.containsPoint(e.position) &&
node.id !== e.element.id &&
!node.children
)[0];
console.log('droped child', node.id);
} |
Regards,
Gowtham.