Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deselectNode event reports nodes, not nodeIds, in previousSelection #1688

Open
micrology opened this issue Jan 17, 2022 · 3 comments · May be fixed by #1734
Open

deselectNode event reports nodes, not nodeIds, in previousSelection #1688

micrology opened this issue Jan 17, 2022 · 3 comments · May be fixed by #1734

Comments

@micrology
Copy link

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)

@nickchomey
Copy link

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?

@micrology
Copy link
Author

Line 18179 of vis-network/esnext/esm/vis-network.js

@nickchomey
Copy link

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.

#1734

@nickchomey nickchomey linked a pull request Mar 25, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants