-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: release input when mouse event is canceled #201
Conversation
@@ -45,8 +45,8 @@ export class MouseEventInput extends EventInput { | |||
return; | |||
} | |||
|
|||
public getTouches(): number { | |||
return 0; | |||
public getTouches(event: InputEventType): number { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you think of dragging with the right mouse button and dragging with the wheel button?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You pointed out a good point I was missing.
To avoid other unexpected exceptions, this statement should check if event.which
is included in the list of inputButton
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue
naver/egjs-flicking#721
Details
This fixes the invalid behavior of "mouse" inputType at
PanInput
.Currently, the "mouse" inputType was not detecting the conditions similar as the "pointercancel" event occurs. Such as a situation that an image inside an element is being dragged.
We can track the situation that mouse input event is canceled, similar to the situation in which "pointercancel" occurs, by checking the
which
in "mousemove" event.This change keeps the same behavior as in hammerjs used in the past version of Axes.