diff --git a/packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/InteractionLayer/InteractionLayer.js b/packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/InteractionLayer/InteractionLayer.js index a11b982ff7..1ec9ee978b 100644 --- a/packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/InteractionLayer/InteractionLayer.js +++ b/packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/InteractionLayer/InteractionLayer.js @@ -142,6 +142,7 @@ function InteractionLayer({ function onFinish(event) { event?.preventDefault?.() + event?.stopPropagation?.() setCreating(false) } diff --git a/packages/lib-classifier/src/plugins/drawingTools/components/draggable/draggable.js b/packages/lib-classifier/src/plugins/drawingTools/components/draggable/draggable.js index b4b1fda3f4..49aace6181 100644 --- a/packages/lib-classifier/src/plugins/drawingTools/components/draggable/draggable.js +++ b/packages/lib-classifier/src/plugins/drawingTools/components/draggable/draggable.js @@ -46,6 +46,9 @@ function draggable(WrappedComponent) { dragStart = DEFAULT_HANDLER, dragMove = DEFAULT_HANDLER, dragEnd = DEFAULT_HANDLER, + onPointerDown, + onPointerMove, + onPointerUp, ...rest }, ref) { const { canvas } = useContext(SVGContext) @@ -62,6 +65,7 @@ function draggable(WrappedComponent) { setDragging(true) pointerId.current = event.pointerId dragStart({ x, y, pointerId: event.pointerId }) + onPointerDown?.(event) wrappedComponent.current?.setPointerCapture(event.pointerId) } @@ -76,6 +80,7 @@ function draggable(WrappedComponent) { dragMove({ currentTarget, x, y, pointerId: event.pointerId }, difference) coords.current = { x, y } } + onPointerMove?.(event) } function onDragEnd(event) { @@ -87,6 +92,7 @@ function draggable(WrappedComponent) { coords.current = { x: null, y: null } setDragging(false) pointerId.current = -1 + onPointerUp?.(event) } return (