Skip to content
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(input): fix pointerEvent bug #1085

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/input/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default class MouseInput extends Input {
this.evWin = MOUSE_WINDOW_EVENTS;

this.pressed = false; // mousedown state
this.init();
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/input/pointerevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default class PointerEventInput extends Input {
this.evEl = POINTER_ELEMENT_EVENTS;
this.evWin = POINTER_WINDOW_EVENTS;

this.init();
this.store = (this.manager.session.pointerEvents = []);
}

Expand Down
2 changes: 1 addition & 1 deletion src/input/singletouch.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class SingleTouchInput extends Input {
this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
this.started = false;

Input.apply(this, arguments);
this.init();
}

handler(ev) {
Expand Down
4 changes: 2 additions & 2 deletions src/input/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
export default class TouchInput extends Input {

constructor() {
TouchInput.prototype.evTarget = TOUCH_TARGET_EVENTS;
TouchInput.prototype.targetIds = {};
super(...arguments);

this.evTarget = TOUCH_TARGET_EVENTS;
this.targetIds = {};

this.init();
}

handler(ev) {
Expand Down
2 changes: 1 addition & 1 deletion src/input/touchmouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const DEDUP_DISTANCE = 25;
export default class TouchMouseInput extends Input {
constructor() {
super(...arguments);

this.init();
let handler = bindFn(this.handler, this);
this.touch = new TouchInput(this.manager, handler);
this.mouse = new MouseInput(this.manager, handler);
Expand Down
3 changes: 0 additions & 3 deletions src/inputjs/input-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export default class Input {
self.handler(ev);
}
};

this.init();

}
/**
* @private
Expand Down