From 1267e0537c9c5889ed385ce49e540fd9ba672517 Mon Sep 17 00:00:00 2001 From: Mark Tolmacs Date: Tue, 26 Aug 2025 11:01:45 +0200 Subject: [PATCH] Fix actionFinalize for new arrow creation --- packages/excalidraw/actions/actionFinalize.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/excalidraw/actions/actionFinalize.tsx b/packages/excalidraw/actions/actionFinalize.tsx index c853167cd..d03a04bb7 100644 --- a/packages/excalidraw/actions/actionFinalize.tsx +++ b/packages/excalidraw/actions/actionFinalize.tsx @@ -82,11 +82,12 @@ export const actionFinalize = register({ ); if (isBindingElement(element)) { - const newArrow = !appState.selectedLinearElement?.selectedPointsIndices; + const newArrow = !!appState.newElement; - const selectedPointsIndices = newArrow - ? [element.points.length - 1] // New arrow creation - : appState.selectedLinearElement.selectedPointsIndices; + const selectedPointsIndices = + newArrow || !appState.selectedLinearElement.selectedPointsIndices + ? [element.points.length - 1] // New arrow creation + : appState.selectedLinearElement.selectedPointsIndices; const draggedPoints: PointsPositionUpdates = selectedPointsIndices.reduce((map, index) => {