refactor(react): do not set selections for all nodes/edges

This commit is contained in:
moklick
2023-12-18 17:21:14 +01:00
parent 4143591d96
commit 0feda91446

View File

@@ -166,7 +166,8 @@ export function getSelectionChanges(
for (const item of items) {
const willBeSelected = selectedIds.has(item.id);
if (item.selected !== willBeSelected) {
// we don't want to set all items to selected=false on the first selection
if (!(item.selected === undefined && !willBeSelected) && item.selected !== willBeSelected) {
if (mutateItem) {
// this hack is needed for nodes. When the user dragged a node, it's selected.
// When another node gets dragged, we need to deselect the previous one,