Skip to content

Commit 5b55f64

Browse files
committed
Fix an issue where browser may be detected as touch-enabled but touch event isn't thrown.
This was causing react-grid-layout/react-grid-layout#16 (comment)
1 parent ba038c1 commit 5b55f64

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)