ensure click-to-select is exclusive (fixes #43) (#45)

This commit is contained in:
David Luzar 2020-01-02 22:03:14 +01:00 committed by Christopher Chedeau
parent b6c30c0550
commit 4c1bf07863
1 changed files with 5 additions and 2 deletions

View File

@ -450,10 +450,13 @@ class App extends React.Component<{}, AppState> {
return isSelected;
});
// deselect everything except target element to-be-selected
elements.forEach(element => {
if (element === selectedElement) return;
element.isSelected = false;
});
if (selectedElement) {
this.setState({ draggingElement: selectedElement });
} else {
clearSelection();
}
isDraggingElements = elements.some(