mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2026-03-13 09:50:09 +08:00
Fix DragCanvasState to stop handling events after mouse is released
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user