diff --git a/CHANGELOG.md b/CHANGELOG.md index 485c895..54cf97d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## v1.6.6 (31/03/2025) + +### Changes + +- :children_crossing: updated to support dragging on shapes in annotation viewer + ## v1.6.5 (16/10/2023) ### Changes diff --git a/package.json b/package.json index 8fe103e..b7c8fb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-mindee-js", - "version": "1.6.5", + "version": "1.6.6", "description": "Front-End Computer Vision SDK for React", "author": "@mindee", "license": "MIT", diff --git a/src/components/AnnotationViewer.tsx b/src/components/AnnotationViewer.tsx index cc72c01..e008c7d 100644 --- a/src/components/AnnotationViewer.tsx +++ b/src/components/AnnotationViewer.tsx @@ -174,6 +174,12 @@ export default function AnnotationViewer({ onShapeMultiSelect, ), ) + + stageObject.current.on('dragstart', () => { + if (stageObject.current?.container()) { + stageObject.current.container().style.cursor = 'grabbing' + } + }) } } diff --git a/src/utils/canvas.ts b/src/utils/canvas.ts index bfa246f..6622f8a 100644 --- a/src/utils/canvas.ts +++ b/src/utils/canvas.ts @@ -59,7 +59,7 @@ const bindEventToPolygon = ( ) => { const stage = polygon.getStage() const shape = polygon.getAttr('shape') - polygon.on('mousedown', (event) => { + polygon.on('mouseup', (event) => { event.cancelBubble = true onClick?.(shape) options?.onClick?.(polygon)