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

Binding event handlers to Surface

Open nornagon opened this issue 10 years ago • 2 comments

It doesn't seem to be possible to bind event handlers to the root Surface object. Given the following, the mouseDown handler never gets called:

<Surface onMouseDown={@mouseDown}>...</Surface>

nornagon avatar Jul 03 '15 18:07 nornagon

I've used something like the following to achieve the same effect:

<div ref='canvas' onMouseDown={@mouseDown} style={{padding: 0, margin: 0, border: 0}}>
  <Surface>...</Surface>
</div>

ThomWright avatar Jul 12 '15 21:07 ThomWright

@spicyj

jimfb avatar Jul 13 '15 05:07 jimfb