Skip to content

Commit 762c9f0

Browse files
tkruggSebastien Pereira
authored andcommitted
added a prevent default on touchend events to prevent native click to fire on iOS7+ fixes #34
1 parent 49f22ad commit 762c9f0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

handlers/touch.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ define([
177177
// (6) fire pointermove > pointerup > fast click > pointerout
178178
utils.dispatchEvent(touchTarget, createPointer(utils.events.MOVE, e, touch, {}));
179179
utils.dispatchEvent(touchTarget, createPointer(utils.events.UP, e, touch, {}));
180+
e.preventDefault();
180181
fireSyntheticClick(touchTarget, touch);
181182
utils.dispatchEvent(touchTarget, createPointer(utils.events.OUT, e, touch, {}));
182183
break;
@@ -186,6 +187,7 @@ define([
186187
// fire synthetic click only if pointer is released on the origin element
187188
// (touch.target is the target element from the touchstart)
188189
if (elementFromPoint === touch.target) {
190+
e.preventDefault();
189191
fireSyntheticClick(touchTarget, touch);
190192
}
191193
utils.dispatchEvent(touchTarget, createPointer(utils.events.OUT, e, touch, {}));

0 commit comments

Comments
 (0)