Fix bug of issue #2062 (#2108)

Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
João Forja 2020-08-30 12:10:07 +01:00 committed by GitHub
parent 46bff3dace
commit 0ab58b38e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 84 additions and 17 deletions

View file

@ -3435,23 +3435,16 @@ class App extends React.Component<ExcalidrawProps, AppState> {
pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements))
) {
// Deselect selected elements
this.setState({
selectedElementIds: {},
selectedGroupIds: {},
});
}
if (draggingElement === null) {
// if no element is clicked, clear the selection and redraw
this.setState({
selectedElementIds: {},
selectedGroupIds: {},
editingGroupId: null,
});
return;
}
if (!elementLocked) {
if (!elementLocked && draggingElement) {
this.setState((prevState) => ({
selectedElementIds: {
...prevState.selectedElementIds,