Update App.tsx

do not delete last element if draggingElement is type selection
This commit is contained in:
zsviczian 2023-09-27 21:33:50 +02:00 committed by GitHub
parent 4765f5536e
commit 452cceae40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -6400,9 +6400,11 @@ class App extends React.Component<AppProps, AppState> {
isInvisiblySmallElement(draggingElement)
) {
// remove invisible element which was added in onPointerDown
this.scene.replaceAllElements(
this.scene.getElementsIncludingDeleted().slice(0, -1),
);
if (draggingElement.type !== "selection") {
this.scene.replaceAllElements(
this.scene.getElementsIncludingDeleted().slice(0, -1),
);
}
this.setState({
draggingElement: null,
});