2
votes

KineticJS seems to have an issue with handling clicks on background layers after redrawing the stage.

I have a jsfiddle with a minimal example of this problem. http://jsfiddle.net/Z2SJS/

On line 34 I have:

stage.draw()

If this is commented out, events fire as they should. When this is present, after dragging the click events to the background will stop firing.

I know that in this example I am not doing anything that would require me to redraw the stage, but in my project I am using the dragstart and dragmove events to manipulate objects on multiple layers, and I then lose reference to my background clicks.

Is there something I need to do to ensure that redrawing the stage does not cause my events to stop firing?

1

1 Answers

1
votes

Instead of using stage.draw() use foreground.draw()

here is the updated fiddle

Alternately: set dragOnTop: false inside the circle instantiation. Fiddle2