From 831c06c49919c9c2ef6faadf47cf5de59505b914 Mon Sep 17 00:00:00 2001 From: SangYeob Yu Date: Tue, 10 Dec 2019 16:29:20 +0900 Subject: [PATCH] fix iPadOS 13 multi-touch issue --- src/mousetracker.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mousetracker.js b/src/mousetracker.js index 8a342d18..396ea6ca 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -2661,7 +2661,7 @@ { eventSource: tracker, pointerType: curGPoint.type, - position: getPointRelativeToAbsolute( curGPoint.currentPos, tracker.element ), + position: curGPoint.currentPos && getPointRelativeToAbsolute( curGPoint.currentPos, tracker.element ), buttons: pointsList.buttons, pointers: tracker.getActivePointerCount(), insideElementPressed: updateGPoint ? updateGPoint.insideElementPressed : false, @@ -2958,10 +2958,16 @@ return false; } + // OS-specific gestures (e.g. swipe up with four fingers in iPadOS 13) + if (gPoints[ 0 ].type === "touch" && typeof gPoints[ 0 ].currentPos === "undefined") { + abortContacts(tracker, event, pointsList); + + return false; + } + for ( i = 0; i < gPointCount; i++ ) { curGPoint = gPoints[ i ]; updateGPoint = pointsList.getById( curGPoint.id ); - if ( updateGPoint ) { // Update the pointer, stop tracking it if not still in this element if ( updateGPoint.captured ) {