uber / react-digraph

A library for creating directed graph editors
MIT License
2.62k stars 269 forks source link

Fixed minor bugs in multiselect #295

Closed ajbogh closed 3 years ago

ajbogh commented 3 years ago

This fixes an issue when you select multiple nodes and then try to move a node that is not within that set. Before it would move all selected as well as the one outside of the set, now it deselects the selected nodes and only moves the one.

This also fixes a problem where moving selected nodes in some sides would only move the one under the mouse while others would jump back to their original position when the mouse moved. This was caused by an incorrect variable reference and fixed by moving some variable assignments slightly up in the code, as well as changing which variable was being used below those assignments.

There still exists a minor visual issue where if you select a single node, then attempt to move another node, the first node will still display as selected even though the graph-view code knows that it is not. This is likely because the Node component isn't re-rendering immediately when the selection has changed. We can work on this issue later.