From 975aa686cca984dddf944c10f9c1e90210f1c611 Mon Sep 17 00:00:00 2001 From: ritk20 Date: Fri, 4 Oct 2024 04:02:50 +0530 Subject: [PATCH 1/3] Duplication of element while dragging issue fixed --- packages/excalidraw/components/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index 8a976dd8bf..3bf8ae6bfa 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -7889,7 +7889,7 @@ class App extends React.Component { } // We duplicate the selected element if alt is pressed on pointer move - if (event.altKey && !pointerDownState.hit.hasBeenDuplicated) { + if (event.altKey && !pointerDownState.hit.hasBeenDuplicated && !this.state.selectedElementsAreBeingDragged) { // Move the currently selected elements to the top of the z index stack, and // put the duplicates where the selected elements used to be. // (the origin point where the dragging started) From f4db72acdbb80b94abaf523182c96a3e8d2af6f9 Mon Sep 17 00:00:00 2001 From: ritk20 Date: Fri, 4 Oct 2024 04:29:26 +0530 Subject: [PATCH 2/3] correct lint --- packages/excalidraw/components/App.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index 3bf8ae6bfa..e20e03ccf0 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -7889,7 +7889,11 @@ class App extends React.Component { } // We duplicate the selected element if alt is pressed on pointer move - if (event.altKey && !pointerDownState.hit.hasBeenDuplicated && !this.state.selectedElementsAreBeingDragged) { + if ( + event.altKey && + !pointerDownState.hit.hasBeenDuplicated && + !this.state.selectedElementsAreBeingDragged + ) { // Move the currently selected elements to the top of the z index stack, and // put the duplicates where the selected elements used to be. // (the origin point where the dragging started) From 7536648b9979abe4e6a9bc4d522d8f7ebf809562 Mon Sep 17 00:00:00 2001 From: ritk20 Date: Tue, 8 Oct 2024 15:13:05 +0530 Subject: [PATCH 3/3] correct lint --- packages/excalidraw/components/App.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index e20e03ccf0..f8b909ee8f 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -7890,8 +7890,8 @@ class App extends React.Component { // We duplicate the selected element if alt is pressed on pointer move if ( - event.altKey && - !pointerDownState.hit.hasBeenDuplicated && + event.altKey && + !pointerDownState.hit.hasBeenDuplicated && !this.state.selectedElementsAreBeingDragged ) { // Move the currently selected elements to the top of the z index stack, and