diff --git a/js/utils/tap.js b/js/utils/tap.js index c868f1e4d6b..142a87c56ea 100644 --- a/js/utils/tap.js +++ b/js/utils/tap.js @@ -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;