From 1ab5e4c7488e19c69e372c7d89b97d4d47e71a9c Mon Sep 17 00:00:00 2001 From: LE TRIONNAIRE Jeremy Date: Fri, 27 Oct 2017 09:31:21 +0200 Subject: [PATCH 1/2] Fix (#13044) --- src/tap-click/tap-click.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tap-click/tap-click.ts b/src/tap-click/tap-click.ts index c42b7c1e3bc..49b7c3cd963 100644 --- a/src/tap-click/tap-click.ts +++ b/src/tap-click/tap-click.ts @@ -23,6 +23,7 @@ export class TapClick { private usePolyfill: boolean; private activator: ActivatorBase; private startCoord: any; + private activatableEle: HTMLElement; private events: UIEventManager; private pointerEvents: PointerEvents; private lastTouchEnd: number; @@ -77,14 +78,14 @@ export class TapClick { return true; } - let activatableEle = getActivatableTarget(ev.target); - if (!activatableEle) { + this.activatableEle = getActivatableTarget(ev.target); + if (!this.activatableEle) { this.startCoord = null; return false; } this.startCoord = pointerCoord(ev); - this.activator && this.activator.downAction(ev, activatableEle, this.startCoord); + this.activator && this.activator.downAction(ev, this.activatableEle, this.startCoord); return true; } @@ -103,7 +104,7 @@ export class TapClick { return; } if (this.activator && ev.target !== this.plt.doc()) { - let activatableEle = getActivatableTarget(ev.target); + let activatableEle = getActivatableTarget(ev.target) || this.activatableEle; if (activatableEle) { this.activator.upAction(ev, activatableEle, this.startCoord); } @@ -112,6 +113,7 @@ export class TapClick { this.handleTapPolyfill(ev); } this.startCoord = null; + this.activatableEle = null; } pointerCancel(ev: UIEvent) { From 2bdf926bf8c14e878660e5591ff1556acc8a0b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20LE=20TRIONNAIRE?= Date: Fri, 27 Oct 2017 12:38:13 +0200 Subject: [PATCH 2/2] Reset activatableEle in pointerCancel --- src/tap-click/tap-click.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tap-click/tap-click.ts b/src/tap-click/tap-click.ts index 49b7c3cd963..30a9a9efaa9 100644 --- a/src/tap-click/tap-click.ts +++ b/src/tap-click/tap-click.ts @@ -120,6 +120,7 @@ export class TapClick { console.debug(`pointerCancel from ${ev.type} ${Date.now()}`); this.startCoord = null; + this.activatableEle = null; this.dispatchClick = false; this.activator && this.activator.clearState(false); this.pointerEvents.stop();