react-sketch icon indicating copy to clipboard operation
react-sketch copied to clipboard

onObjectAdded event not triggered

Open sonnyky opened this issue 5 years ago • 2 comments

I'm trying to find a way to trigger an event after drawing an object. I saw that there are onObjectAdded and also onMouseUp events being defined but neither of these are working.

<SketchField onObjectAdded={this.onBoundingBox} />

this also does not fire the event:

<SketchField onMouseUp={this.onBoundingBox} />

The content of this.onBoundingBox is just a console.log for now. But this works with onChange. I'm wondering if I did something wrong or if this is an issue? Do you have any examples of how to use the events?

sonnyky avatar Oct 14 '20 07:10 sonnyky

@sonnyky , apparently, the npm package was not updated with the latest changes. Have tried to use https://www.npmjs.com/package/react-sketch2 which seems to be created due the same issues as in our case, the package handles onObjectAdded, etc. events

nakusyat avatar Nov 12 '20 05:11 nakusyat

@nakusyat Thank you for the info. I'll give it a try this week and report how it goes

sonnyky avatar Nov 15 '20 12:11 sonnyky