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

Event when you mousedown and move outside canvas. #1744

Closed bogdan-nourescu closed 2 months ago

bogdan-nourescu commented 3 months ago

Starting from this code: https://konvajs.org/downloads/code/select_and_transform/Basic_demo.html

I just added a console.log("eventName") on each of the event listeners: mouseup, click, mousedown. If you start a selection and finish it, with will only print "mousedown mouseup" If you start a selection, and don't release the mouse until you exit the canvas, the events start behaving differently. If you do the same thing as before, it will print "mousedown mouseup click" Animation

lavrton commented 2 months ago

I changed a demo bit. The selection rectangle hit area is affecting events flow. Disabling events for it with listening: false works better.