mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 04:53:58 +08:00
fix(tapclick): click to non-activable elements
This commit is contained in:
@ -56,6 +56,12 @@ export class TapClick {
|
|||||||
if (this.startCoord) {
|
if (this.startCoord) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!this.app.isEnabled()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastTouchEnd = 0;
|
||||||
|
this.dispatchClick = true;
|
||||||
|
|
||||||
let activatableEle = getActivatableTarget(ev.target);
|
let activatableEle = getActivatableTarget(ev.target);
|
||||||
if (!activatableEle) {
|
if (!activatableEle) {
|
||||||
@ -63,8 +69,6 @@ export class TapClick {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lastTouchEnd = 0;
|
|
||||||
this.dispatchClick = true;
|
|
||||||
this.startCoord = pointerCoord(ev);
|
this.startCoord = pointerCoord(ev);
|
||||||
this.activator && this.activator.downAction(ev, activatableEle, this.startCoord);
|
this.activator && this.activator.downAction(ev, activatableEle, this.startCoord);
|
||||||
return true;
|
return true;
|
||||||
@ -102,6 +106,7 @@ export class TapClick {
|
|||||||
|
|
||||||
pointerCancel(ev: UIEvent) {
|
pointerCancel(ev: UIEvent) {
|
||||||
console.debug(`pointerCancel from ${ev.type} ${Date.now()}`);
|
console.debug(`pointerCancel from ${ev.type} ${Date.now()}`);
|
||||||
|
|
||||||
this.startCoord = null;
|
this.startCoord = null;
|
||||||
this.dispatchClick = false;
|
this.dispatchClick = false;
|
||||||
this.activator && this.activator.clearState();
|
this.activator && this.activator.clearState();
|
||||||
@ -149,6 +154,10 @@ export class TapClick {
|
|||||||
console.debug('click prevent: appDisabled');
|
console.debug('click prevent: appDisabled');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (this.gestureCtrl.isCaptured()) {
|
||||||
|
console.debug('click prevent: tap-click (gesture is captured)');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user