Skip to content

Commit

Permalink
Fix an issue where browser may be detected as touch-enabled but touch…
Browse files Browse the repository at this point in the history
… event isn't thrown.

This was causing react-grid-layout/react-grid-layout#16 (comment)
  • Loading branch information
MDev128 committed Jan 17, 2015
1 parent cc49be6 commit f1bce25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var dragEventFor = (function () {
* get {clientX, clientY} positions of control
* */
function getControlPosition(e) {
var position = !isTouchDevice ? e : e.touches[0];
var position = (e.touches && e.touches[0]) || e;
return {
clientX: position.clientX,
clientY: position.clientY
Expand Down

0 comments on commit f1bce25

Please sign in to comment.