From 013329e3b32c69f0198cf3726efff76c26384ef8 Mon Sep 17 00:00:00 2001 From: Andrew Benz Date: Thu, 1 Dec 2016 20:55:30 -0600 Subject: [PATCH] Bypass setTimeout when activation should happen immediately --- src/TappableMixin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TappableMixin.js b/src/TappableMixin.js index 6336cd3..264cae7 100644 --- a/src/TappableMixin.js +++ b/src/TappableMixin.js @@ -73,7 +73,11 @@ var Mixin = { this.initScrollDetection(); this.initPressDetection(event, this.endTouch); this.initTouchmoveDetection(); - this._activeTimeout = setTimeout(this.makeActive, this.props.activeDelay); + if (this.props.activeDelay > 0) { + this._activeTimeout = setTimeout(this.makeActive, this.props.activeDelay); + } else { + this.makeActive(); + } } else if (this.onPinchStart && (this.props.onPinchStart || this.props.onPinchMove || this.props.onPinchEnd) && event.touches.length === 2) {