Skip to content

Commit

Permalink
fix(tapclick): click to non-activable elements
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Dec 5, 2016
1 parent f5b4980 commit c6facf3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/tap-click/tap-click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,19 @@ export class TapClick {
if (this.startCoord) {
return false;
}
if (!this.app.isEnabled()) {
return false;
}

this.lastTouchEnd = 0;
this.dispatchClick = true;

let activatableEle = getActivatableTarget(ev.target);
if (!activatableEle) {
this.startCoord = null;
return false;
}

this.lastTouchEnd = 0;
this.dispatchClick = true;
this.startCoord = pointerCoord(ev);
this.activator && this.activator.downAction(ev, activatableEle, this.startCoord);
return true;
Expand Down Expand Up @@ -102,6 +106,7 @@ export class TapClick {

pointerCancel(ev: UIEvent) {
console.debug(`pointerCancel from ${ev.type} ${Date.now()}`);

this.startCoord = null;
this.dispatchClick = false;
this.activator && this.activator.clearState();
Expand Down Expand Up @@ -149,6 +154,10 @@ export class TapClick {
console.debug('click prevent: appDisabled');
return true;
}
if (this.gestureCtrl.isCaptured()) {
console.debug('click prevent: tap-click (gesture is captured)');
return true;
}
return false;
}

Expand Down

0 comments on commit c6facf3

Please sign in to comment.