diff --git a/packages/react-canvas-core/src/states/DragCanvasState.ts b/packages/react-canvas-core/src/states/DragCanvasState.ts index 0d15c3e..aa62552 100644 --- a/packages/react-canvas-core/src/states/DragCanvasState.ts +++ b/packages/react-canvas-core/src/states/DragCanvasState.ts @@ -46,6 +46,15 @@ export class DragCanvasState extends AbstractDisplacementState { } fireMouseMoved(event: AbstractDisplacementStateEvent) { + const isMouseDown = event.event.buttons !== 0; + + if (!isMouseDown) { + // If the mouse is not down, it should return to the previous state + // and stop processing the mouse move event + this.engine.getStateMachine().popState(); + return; + } + if (this.config.allowDrag) { this.engine .getModel()