Skip to content

Commit 3e123b2

Browse files
committed
Bug fix hasTouch check. Not possible do use document.ontouchstart === null check, because this does not work if ontouchstart method is used to catch touches on document. Added proper check for "ontouchtart" method.
1 parent f5e8a77 commit 3e123b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

snap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
eventList = {},
4949
utils = {
50-
hasTouch: (doc.ontouchstart === null),
50+
hasTouch: ('ontouchstart' in document.documentElement || window.navigator.msPointerEnabled),
5151
eventType: function(action) {
5252
var eventTypes = {
5353
down: (utils.hasTouch ? 'touchstart' : 'mousedown'),

0 commit comments

Comments
 (0)