Browse Source

Fix a bug on the Pointer Tracker

customisations
alemart 2 months ago
parent
commit
7dbb1645bb
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/trackers/pointer-tracker/pointer-tracker.ts

+ 6
- 0
src/trackers/pointer-tracker/pointer-tracker.ts View File

@@ -349,6 +349,12 @@ export class PointerTracker implements Tracker
349 349
             // what if we receive 'began' after 'ended' in the same frame?
350 350
             else if(phase == 'began' && current) {
351 351
                 if(current.phase == 'ended' || current.phase == 'canceled') {
352
+                    // ignore the 'began' and maintain the 'ended'
353
+                    // issue on Epiphany: pointerenter may come after a pointerup -> pointerleave sequence
354
+                    if(event.type == 'pointerenter')
355
+                        continue;
356
+
357
+                    // ignore the 'ended' and the 'began'
352 358
                     this._newPointers.delete(id);
353 359
                     continue;
354 360
                 }

Loading…
Cancel
Save