Skip to content

Commit

Permalink
Revert "Make touch events passive like mouse events (playcanvas#4279)"
Browse files Browse the repository at this point in the history
This reverts commit 1ebfd36.
  • Loading branch information
slimbuck committed Jun 16, 2022
1 parent 8577cfe commit 4a308bc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/input/touch-device.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { platform } from '../core/platform.js';
import { EventHandler } from '../core/event-handler.js';

import { TouchEvent } from './touch-event.js';
Expand Down Expand Up @@ -41,11 +40,10 @@ class TouchDevice extends EventHandler {

this._element = element;

const opts = platform.passiveEvents ? { passive: true } : false;
this._element.addEventListener('touchstart', this._startHandler, opts);
this._element.addEventListener('touchend', this._endHandler, opts);
this._element.addEventListener('touchmove', this._moveHandler, opts);
this._element.addEventListener('touchcancel', this._cancelHandler, opts);
this._element.addEventListener('touchstart', this._startHandler, false);
this._element.addEventListener('touchend', this._endHandler, false);
this._element.addEventListener('touchmove', this._moveHandler, false);
this._element.addEventListener('touchcancel', this._cancelHandler, false);
}

/**
Expand Down

0 comments on commit 4a308bc

Please sign in to comment.