fix(system): ensure auto-pan stops when state changes during drag

This commit is contained in:
Damian Stasik
2025-01-31 14:58:16 +01:00
parent 043c8120ac
commit 44c836da32
+7 -1
View File
@@ -214,7 +214,13 @@ export function XYDrag<OnNodeDrag extends (e: any, nodes: any, node: any) => voi
return;
}
const { transform, panBy, autoPanSpeed } = getStoreItems();
const { transform, panBy, autoPanSpeed, autoPanOnNodeDrag } = getStoreItems();
if (!autoPanOnNodeDrag) {
autoPanStarted = false;
cancelAnimationFrame(autoPanId);
return;
}
const [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed);