Merge pull request #4990 from damianstasik/autopan-fix
fix(system): ensure auto-pan stops when state changes during drag
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user