You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the very least this is a mismatch between actual behaviour and documented behaviour. The docs say click events are dispatched when the left mouse button is pressed and released on a display object:
* Dispatched when the user presses their left mouse button and then releases it while over the display object.
* See the {{#crossLink "MouseEvent"}}{{/crossLink}} class for a listing of event properties.
* @event click
* @since 0.6.0
*/
This matches the behaviour of native dom events, where click is fired for the primary mouse button but not the secondary button (unlike mousedown/up which fire for any mouse button).
However EaselJS doesn't listen to native click events on the canvas element, instead it dispatches its click events from the mouseup listener. The only check is that the mouseup occured over the same display object as the originating mousedown:
Click should work on a primary key but it is also working for other keys also.
I have came across one scenario where pressUp of left click is getting missed and that is creating an issue.
steps are as follows:
1.left mouseDown on object.
2.right mouseDown on same object.
3.right pressUp on object.
if we follow this order left mouseUp is getting missed it is not getting fired nor it is present after that point.
At the very least this is a mismatch between actual behaviour and documented behaviour. The docs say click events are dispatched when the left mouse button is pressed and released on a display object:
EaselJS/src/easeljs/display/DisplayObject.js
Lines 546 to 551 in aea6424
This matches the behaviour of native dom events, where click is fired for the primary mouse button but not the secondary button (unlike mousedown/up which fire for any mouse button).
However EaselJS doesn't listen to native click events on the canvas element, instead it dispatches its click events from the mouseup listener. The only check is that the mouseup occured over the same display object as the originating mousedown:
EaselJS/src/easeljs/display/Stage.js
Line 711 in aea6424
Should EaselJS be checking the mouse button before dispatching the click event? (That's what PixiJS does)
Or are the docs wrong, and click events are supposed to be dispatched for the secondary mouse button?
The text was updated successfully, but these errors were encountered: