From 4fa6f77d2542cb7c582a36918ef7fc38207a8357 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 31 Jul 2017 17:13:26 -0700 Subject: [PATCH] [fix] TouchableMixin async race condition When a Touchable component returns 0 for `touchableGetHighlightDelayMS()` the mixin may occasionally try to detect if the press event occurred on the hit area before the hit area has been determined. Clearing out this value ensures that `positionOnActivate` is recalculated before that takes place. Close #586 --- src/components/Touchable/Touchable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Touchable/Touchable.js b/src/components/Touchable/Touchable.js index 90af32ef..5f663925 100644 --- a/src/components/Touchable/Touchable.js +++ b/src/components/Touchable/Touchable.js @@ -399,6 +399,7 @@ const TouchableMixin = { if (delayMS !== 0) { this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS); } else { + this.state.touchable.positionOnActivate = null; this._handleDelay(e); }