embiem / react-canvas-draw

React Component for drawing in canvas
https://embiem.github.io/react-canvas-draw/
MIT License
902 stars 315 forks source link

onClick event #113

Closed ziaongit closed 3 years ago

ziaongit commented 3 years ago

How we can add onClick event to React Canvas Draw. It will be great if the user click on the can add mark.

embiem commented 3 years ago

onClick event is currently not supported. Could you please elaborate a bit more on what would be your use case for it?

ziaongit commented 3 years ago

image If we have a click event then we can add notes to that. Click on the spot and add a note. What I want to achieve is given in this example.

https://codepen.io/onur_kaplan/pen/XaWeNK

embiem commented 3 years ago

Ah I see. In my opinion this functionality should rather live outside of the react-canvas-draw component, like a wrapper that detects the clicks. But I'm open for discussion on this, especially if other people would like to have this functionality built-in.