From 72fc528b3c47602a83d411dd0afc9b95886c0a98 Mon Sep 17 00:00:00 2001 From: Mark Salsbery <> Date: Tue, 4 May 2021 16:55:37 -0700 Subject: [PATCH] removeContact only on existing tracked pointer --- src/mousetracker.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mousetracker.js b/src/mousetracker.js index 60127c97..75ec7be0 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -3281,11 +3281,13 @@ gPoint = updateGPoint; } else { - // Initialize for tracking and add to the tracking list (no pointerover or pointermove event occurred before this) + // Initialize for tracking and add to the tracking list (no pointerenter event occurred before this) + $.console.warn('pointerdown event on untracked pointer'); gPoint.captured = false; // Handled by updatePointerCaptured() gPoint.insideElementPressed = true; gPoint.insideElement = true; startTrackingPointer( pointsList, gPoint ); + return; } pointsList.addContact(); @@ -3410,6 +3412,9 @@ updateGPoint = pointsList.getById( gPoint.id ); if ( updateGPoint ) { + pointsList.removeContact(); + //$.console.log('contacts-- ', pointsList.contacts); + // Update the pointer, stop tracking it if not still in this element if ( updateGPoint.captured ) { //updateGPoint.captured = false; // Handled by updatePointerCaptured() @@ -3436,9 +3441,6 @@ updateGPoint = gPoint; } - pointsList.removeContact(); - //$.console.log('contacts-- ', pointsList.contacts); - if ( !eventInfo.preventGesture && !eventInfo.defaultPrevented ) { if ( wasCaptured ) { // Pointer was activated in our element but could have been removed in any element since events are captured to our element