It happens rarely, but it does happen and I’m trying to get to the root of it.
As you can see in the screenshot I’ve attached, there is a link which says “2k” on it. That is not in the newly changed model, but it does exist in a previous older model.
I’m using a redux-like environment and I was passing along the diagram item on every click. And, somehow the item was remaining as the old item. It’s my environment, not gojs.
Weird that even if that object no longer exists, gojs will still try to draw it.
Yes, the user can select it. It’s like this: on the click event of the diagram I dispatch an action (redux) and then in the reducer I focus on a button (which is hidden - for WCAG purposes). But, the focus of the button triggers the diagram to select the item (but, because of the react-like environment, the focus function sends the previous link, thus making the diagram link select the old link)
The Diagram.model property setter explicitly clears out the Diagram.selection collection and other places where there might be references to Parts of the old Model.
Why does the (HTML?) button getting focus cause the selection to change?
Why are you re-creating the diagram when it appears that you want to do something with the clicked Part?
For the sake of WCAG I am generating buttons for all nodes and all links. When the user focuses on one of those buttons I make the diagram select that node. The voice-over then reads everything nicely and the user thinks he’s actually tabbing on the graph
The merge… methods use the key value to find the corresponding Node or Link in the current Model, and then update its properties to correspond to the given data properties.
Under the assumption that the props data is immutable, it makes a deep copy of any data that it adds to the GoJS Model, which is assumed to be mutable.