[ReactNative] Pass events through to touchable handlers

Summary:
We want to be able to access the touch data within our components' event handlers, so we need to thread the event object all the way through to them.
This commit is contained in:
Bill Fisher
2015-08-21 01:52:13 -07:00
parent 2cd02d94ff
commit debca6d24f
5 changed files with 41 additions and 35 deletions

View File

@@ -636,19 +636,19 @@ var TouchableMixin = {
}
if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) {
this.touchableHandleLongPress && this.touchableHandleLongPress();
this.touchableHandleLongPress && this.touchableHandleLongPress(e);
}
if (newIsHighlight && !curIsHighlight) {
this._savePressInLocation(e);
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn();
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
} else if (!newIsHighlight && curIsHighlight && this.touchableHandleActivePressOut) {
if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {
this.pressOutDelayTimeout = this.setTimeout(function() {
this.touchableHandleActivePressOut();
this.touchableHandleActivePressOut(e);
}, this.touchableGetPressOutDelayMS());
} else {
this.touchableHandleActivePressOut();
this.touchableHandleActivePressOut(e);
}
}