Skip to content

Commit fcef772

Browse files
committed
Merge pull request #33 from STRML/fixTouch
Fix an issue where browser may be detected as touch-enabled but e.touches is undefined.
2 parents ba038c1 + 5b55f64 commit fcef772

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/draggable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ var dragEventFor = (function () {
8989
* get {clientX, clientY} positions of control
9090
* */
9191
function getControlPosition(e) {
92-
var position = !isTouchDevice ? e : e.touches[0];
92+
var position = (e.touches && e.touches[0]) || e;
9393
return {
9494
clientX: position.clientX,
9595
clientY: position.clientY

0 commit comments

Comments
 (0)