mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-03 10:46:19 +00:00
[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
This commit is contained in:
@@ -399,6 +399,7 @@ const TouchableMixin = {
|
|||||||
if (delayMS !== 0) {
|
if (delayMS !== 0) {
|
||||||
this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);
|
this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);
|
||||||
} else {
|
} else {
|
||||||
|
this.state.touchable.positionOnActivate = null;
|
||||||
this._handleDelay(e);
|
this._handleDelay(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user