Skip to content

Commit

Permalink
fix(tap): only check classList on tap target if it has classList
Browse files Browse the repository at this point in the history
Closes #1677
  • Loading branch information
ajoslin committed Jul 7, 2014
1 parent 1c789f8 commit 5bf7532
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/utils/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,10 @@ function tapHasPointerMoved(endEvent) {
}
var endCoordinates = getPointerCoordinates(endEvent);

var releaseTolerance = (endEvent.target.classList.contains('button') ? TAP_RELEASE_BUTTON_TOLERANCE : TAP_RELEASE_TOLERANCE);
var hasClassList = endEvent.target.classList && endEvent.target.classList.contains;
var releaseTolerance = hasClassList & endEvent.target.classList.contains('button') ?
TAP_RELEASE_BUTTON_TOLERANCE :
TAP_RELEASE_TOLERANCE;

return Math.abs(tapPointerStart.x - endCoordinates.x) > releaseTolerance ||
Math.abs(tapPointerStart.y - endCoordinates.y) > releaseTolerance;
Expand Down

0 comments on commit 5bf7532

Please sign in to comment.