From 0de5000012043a8add6f6c2574922853197e5e9d Mon Sep 17 00:00:00 2001 From: draedful Date: Thu, 23 Apr 2026 20:36:21 +0300 Subject: [PATCH] fix(Groups): prevent stale state from overwriting drag position in subscribeToGroup During group drag, handleDrag() calls setState({ rect: newPos }) which stores the new rect in data.nextState (this.state is not updated until the render cycle). When onDragUpdate then moves the blocks, the reactive signal fires synchronously and subscribeToGroup calls setState({ ...this.state, ...groupWithoutRect }). Since this.state is still stale (old rect), it overwrites data.nextState.rect back to the original position on every frame, causing the group to appear stuck or move very slowly. Fix: use getState() instead of this.state to spread the pending nextState, which already contains the correct rect set by handleDrag in the same frame. Co-Authored-By: Claude Sonnet 4.6 --- src/components/canvas/groups/Group.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/canvas/groups/Group.ts b/src/components/canvas/groups/Group.ts index 279a8090..43684c40 100644 --- a/src/components/canvas/groups/Group.ts +++ b/src/components/canvas/groups/Group.ts @@ -287,9 +287,12 @@ export class Group extends GraphComponent