Skip to content

Commit 86c341c

Browse files
committed
Revert "No need to target find on the touchstart"
This reverts commit bd19544.
1 parent bd19544 commit 86c341c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/touch.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
(function(scope) {
88
var dispatcher = scope.dispatcher;
99
var captureInfo = dispatcher.captureInfo;
10+
var findTarget = scope.findTarget;
1011
var allShadows = scope.targetFinding.allShadows.bind(scope.targetFinding);
1112
var pointermap = dispatcher.pointermap;
1213
var touchMap = Array.prototype.map.call.bind(Array.prototype.map);
@@ -143,23 +144,18 @@
143144
}
144145
return ret;
145146
},
146-
findTarget: function(ev) {
147-
if (this.currentTouchEvent.type === 'touchstart') {
148-
return this.currentTouchEvent.target;
149-
}
150-
return scope.findTarget(ev);
151-
},
152147
touchToPointer: function(inTouch) {
153148
var cte = this.currentTouchEvent;
154149
var e = dispatcher.cloneEvent(inTouch);
155150
// Spec specifies that pointerId 1 is reserved for Mouse.
156151
// Touch identifiers can start at 0.
157152
// Add 2 to the touch identifier for compatibility.
158153
var id = e.pointerId = inTouch.identifier + 2;
159-
e.target = captureInfo[id] || this.findTarget(e);
154+
e.target = captureInfo[id] || findTarget(e);
160155
e.bubbles = true;
161156
e.cancelable = true;
162157
e.detail = this.clickCount;
158+
e.button = 0;
163159
e.buttons = this.typeToButtons(cte.type);
164160
e.width = inTouch.webkitRadiusX || inTouch.radiusX || 0;
165161
e.height = inTouch.webkitRadiusY || inTouch.radiusY || 0;

0 commit comments

Comments
 (0)