vis-network
vis-network copied to clipboard
deselectNode event reports nodes, not nodeIds, in previousSelection
The documentation for the deselectNode event states that the property returned includes an array of nodeIds for the nodes previously selected:
previousSelection: {
nodes: [Array of previously selected nodeIds],
edges: [Array of previously selected edgeIds]
}
However, using version 9.1.0, the array is not of nodeIds, but of nodes, for example:
console.log(props.previousSelection.nodes)
[Node1]
0: Node1 {options: {…}, globalOptions: {…}, defaultOptions: {…}, body: {…}, edges: Array(3), …}
length: 1
[[Prototype]]: Array(0)
I see this now as well. My first thought was "great, more info", but clearly this would break people's code if it was just looking for the id, and is just wholly unnecessary. Did you find the relevant code that causes this?
Line 18179 of vis-network/esnext/esm/vis-network.js
That path doesn't map onto what I've got, but I just submitted this pull request with a fix. You can check the actual file change as well as the code I provided in the comment which I used directly in my vis-network.min.js file.
https://github.com/visjs/vis-network/pull/1734