Skip to content

Commit c6facf3

Browse files
committed
fix(tapclick): click to non-activable elements
1 parent f5b4980 commit c6facf3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/tap-click/tap-click.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,19 @@ export class TapClick {
5656
if (this.startCoord) {
5757
return false;
5858
}
59+
if (!this.app.isEnabled()) {
60+
return false;
61+
}
62+
63+
this.lastTouchEnd = 0;
64+
this.dispatchClick = true;
5965

6066
let activatableEle = getActivatableTarget(ev.target);
6167
if (!activatableEle) {
6268
this.startCoord = null;
6369
return false;
6470
}
6571

66-
this.lastTouchEnd = 0;
67-
this.dispatchClick = true;
6872
this.startCoord = pointerCoord(ev);
6973
this.activator && this.activator.downAction(ev, activatableEle, this.startCoord);
7074
return true;
@@ -102,6 +106,7 @@ export class TapClick {
102106

103107
pointerCancel(ev: UIEvent) {
104108
console.debug(`pointerCancel from ${ev.type} ${Date.now()}`);
109+
105110
this.startCoord = null;
106111
this.dispatchClick = false;
107112
this.activator && this.activator.clearState();
@@ -149,6 +154,10 @@ export class TapClick {
149154
console.debug('click prevent: appDisabled');
150155
return true;
151156
}
157+
if (this.gestureCtrl.isCaptured()) {
158+
console.debug('click prevent: tap-click (gesture is captured)');
159+
return true;
160+
}
152161
return false;
153162
}
154163

0 commit comments

Comments
 (0)