From 594da90d3caaab3b77f253ef59c9ec8b8f001eb0 Mon Sep 17 00:00:00 2001
From: Matthias Konitzny <konitzny@ibr.cs.tu-bs.de>
Date: Thu, 15 Sep 2022 14:21:53 +0200
Subject: [PATCH] onBoxSelect handler will no longer allow nodes to be selected
 more than once.

---
 src/editor/editor.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/editor/editor.tsx b/src/editor/editor.tsx
index 546ddfa..5659d3f 100644
--- a/src/editor/editor.tsx
+++ b/src/editor/editor.tsx
@@ -188,7 +188,9 @@ export class Editor extends React.PureComponent<any, stateTypes> {
             return;
         }
 
-        this.selectNodes(selectedNodes.concat(this.state.selectedNodes));
+        this.selectNodes([
+            ...new Set(selectedNodes.concat(this.state.selectedNodes)),
+        ]);
     }
 
     /**
-- 
GitLab