-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
selection:changed event handler returns cells already removed in the graph #2466
Comments
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
更新到 1.33.0 版本。 |
已更新 |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the bug
When a node and an edge are deleted together with
Graph.removeCells
, theselected
property passed byGraph
'sselection:changed
event contains cells that don't exist in the graph.Your Example Website or App
See the minimal reproducible example below.
Steps to Reproduce the Bug or Issue
selection:changed
should contain anull
returned bygetCellById
, indicating that the cell is no longer in the graph.Expected behavior
selection:changed
should always return cells that exist in the graph.Screenshots or Videos
The following screenshot shows the developer console after a bug is reproduced:
Platform
Additional context
The bug is likely caused by a corner case in
Model.removeConnectedEdges
. Because a node's connected edges are removed after the node itself but before unselecting the node, the selection still contains the already-removed node. When theselection:changed
event is fired by the removal of connected edges, the removed node is contained in theselected
property.The text was updated successfully, but these errors were encountered: