Skip to content

Commit 5bf7532

Browse files
committed
fix(tap): only check classList on tap target if it has classList
Closes #1677
1 parent 1c789f8 commit 5bf7532

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: js/utils/tap.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,10 @@ function tapHasPointerMoved(endEvent) {
530530
}
531531
var endCoordinates = getPointerCoordinates(endEvent);
532532

533-
var releaseTolerance = (endEvent.target.classList.contains('button') ? TAP_RELEASE_BUTTON_TOLERANCE : TAP_RELEASE_TOLERANCE);
533+
var hasClassList = endEvent.target.classList && endEvent.target.classList.contains;
534+
var releaseTolerance = hasClassList & endEvent.target.classList.contains('button') ?
535+
TAP_RELEASE_BUTTON_TOLERANCE :
536+
TAP_RELEASE_TOLERANCE;
534537

535538
return Math.abs(tapPointerStart.x - endCoordinates.x) > releaseTolerance ||
536539
Math.abs(tapPointerStart.y - endCoordinates.y) > releaseTolerance;

0 commit comments

Comments
 (0)