About Free Link Copy

If free link connected at a node, and I only select the node and copy this node to clip board,
the free link also copied to the clip board. even I didn’t select the free link. when I paste to diagram the link will appear with pasted node.
The reproduce point is the link must connected to a node and other end is free.

Does it help to set CommandHandler.copiesConnectedLinks to false?

But it will also not copy normal link both end have nodes be linked.

You didn’t say that was still a requirement. OK, never mind about that suggestion.

I suppose you could implement a “SelectionCopied” DiagramEvent listener that removes any partly connected (or completely disconnected?) selected Link.

I can implement it, that is good, but see, it was not copy normal link both end have nodes, but dose copy one end is empty link, In the gojs movements are different.

Not so beautiful, I think this is will work.

DrawCommandHandler.prototype.copyToClipboard = function(coll) {
  let collFixFreeLinkBug = new go.Set(/*go.Part*/);
  coll.each(function(o) {
    if (o instanceof go.Link) {
      if(o.isSelected) {
        collFixFreeLinkBug.add(o);
      } else {
        if (o.fromNode == null || o.toNode == null) {
        } else {
          collFixFreeLinkBug.add(o);
        }
      }
    } else {
      collFixFreeLinkBug.add(o);
    }
  })
  go.CommandHandler.prototype.copyToClipboard.call(this, collFixFreeLinkBug);
};