changedSelection event subject always null

I added a changeSelection handle to my diagram:

private registerEvents() {
    this.diagram.addDiagramListener("ChangedSelection", (event) => this.onSelectionChanged(event));

private onSelectionChanged(event: go.DiagramEvent) {
    console.log("Subject:", event.subject);

event.subject is always null, no matter what I select or deselect. I expected this to be the same iterable as diagram.selection (which does work properly).

Am I wrong to expect this?

The documentation for the “ChangedSelection” DiagramEvent, DiagramEvent | GoJS API, doesn’t say that the DiagramEvent.subject is supposed to be any particular value.

So event.diagram.selection should give you the collection of selected Parts.

I suppose we could set the subject to be that collection, if you like.

Okay, thank you.

It doesn’t really matter, I just expected the subject to contain something. If nothing else, it might be nice to be explicit about this in the documentation.

OK, thanks for the feedback.