konvajs / konva

Konva.js is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://konvajs.org/
Other
11.07k stars 896 forks source link

How to bypass onclick events between layers? #1780

Closed teddybee closed 2 weeks ago

teddybee commented 2 weeks ago

I have two layers. On the back layer there are shapes that I can select by mouse click. On the front layer I can draw transparent rectangles. I need the front layer functions only as an information holder/GUI. My problem is the rectangles are preventing onclick events on the shapes behind them.

Are there any method to disable/prevent the layer onclick handling or pipe over them to the back layer?

kamil-zak commented 2 weeks ago

You can disable listening on front nodes

https://konvajs.org/docs/events/Listen_for_Events.html

teddybee commented 2 weeks ago

Thank you, it's working.