Merge pull request #4990 from damianstasik/autopan-fix

fix(system): ensure auto-pan stops when state changes during drag
This commit is contained in:
Moritz Klack
2025-02-12 13:44:22 +01:00
committed by GitHub
2 changed files with 12 additions and 1 deletions

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);