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.56k stars 925 forks source link

Race condition when calling `off` in event handlers #1813

Open luin opened 2 months ago

luin commented 2 months ago

To reproduce

  1. Go to https://jsbin.com/sosumon/edit?html,js,output
  2. Click the stage

Expected

On the first click, it should log both "handler1" and "handler2".

Actual behavior

On the first click, only "handler1" is logged.

lavrton commented 2 months ago

Are you interested in making a pull request with test + fix?

luin commented 2 months ago

@lavrton Sure created one.