Skip to content

Commit 1cf976a

Browse files
author
Sebastien Pereira
committed
Fixes #15. e.preventDefault() throws error.
1 parent b54f4b4 commit 1cf976a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

handlers/utils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ define([
8585
var e = createMouseEvent(pointerType, props);
8686
fixButtonsProperties(e, props.buttons);
8787
setPointerProperties(e, props);
88-
mapNativeFunctions(e);
88+
mapNativeFunctions(e, nativeEvent);
8989
return e;
9090
};
9191

@@ -332,6 +332,9 @@ define([
332332
* @param nativeEvent underlying event which contributes to this pointer event.
333333
*/
334334
function mapNativeFunctions(e, nativeEvent) {
335+
if (e.type === utils.GOTCAPTURE || e.type === utils.LOSTCAPTURE) {
336+
return; //no default action on pointercapture events
337+
}
335338
var _stopPropagation = e.stopPropagation,
336339
_preventDefault = e.preventDefault;
337340
e.stopPropagation = function () {

0 commit comments

Comments
 (0)