doubletap: don't check pointerId (always different on ios, and checking position should be enough) (#356)

This commit is contained in:
jean-emmanuel 2018-09-01 01:53:35 +02:00
parent 13f2133c6a
commit 42a1390170
2 changed files with 3 additions and 5 deletions

View file

@ -2,8 +2,7 @@ module.exports = (element, callback)=>{
var lastTapTime = 0,
lastTapX,
lastTapY,
touchId
lastTapY
element.addEventListener('fast-click', (event)=>{
@ -14,7 +13,7 @@ module.exports = (element, callback)=>{
if (
tapLength < DOUBLE_TAP_TIME && touchId == eventData.pointerId &&
tapLength < DOUBLE_TAP_TIME &&
Math.abs(lastTapX - eventData.pageX) < 20 &&
Math.abs(lastTapY - eventData.pageY) < 20
@ -26,7 +25,6 @@ module.exports = (element, callback)=>{
} else {
lastTapTime = tapTime
touchId = eventData.pointerId
lastTapX = eventData.pageX
lastTapY = eventData.pageY