Forward touchable events to TouchableNativeFeedback
Summary:Fixes #6256 Closes https://github.com/facebook/react-native/pull/6344 Differential Revision: D3021478 Pulled By: mkonicek fb-gh-sync-id: 350cf72ad73d06d97cc1663e0d69c0c97977689e shipit-source-id: 350cf72ad73d06d97cc1663e0d69c0c97977689e
This commit is contained in:
parent
2070efa019
commit
06a41c3785
|
@ -44,6 +44,8 @@ var TouchableView = requireNativeComponent('RCTView', null, {
|
|||
}
|
||||
});
|
||||
|
||||
type Event = Object;
|
||||
|
||||
var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
|
||||
|
||||
/**
|
||||
|
@ -138,23 +140,23 @@ var TouchableNativeFeedback = React.createClass({
|
|||
* `Touchable.Mixin` self callbacks. The mixin will invoke these if they are
|
||||
* defined on your component.
|
||||
*/
|
||||
touchableHandleActivePressIn: function() {
|
||||
this.props.onPressIn && this.props.onPressIn();
|
||||
touchableHandleActivePressIn: function(e: Event) {
|
||||
this.props.onPressIn && this.props.onPressIn(e);
|
||||
this._dispatchPressedStateChange(true);
|
||||
this._dispatchHotspotUpdate(this.pressInLocation.locationX, this.pressInLocation.locationY);
|
||||
},
|
||||
|
||||
touchableHandleActivePressOut: function() {
|
||||
this.props.onPressOut && this.props.onPressOut();
|
||||
touchableHandleActivePressOut: function(e: Event) {
|
||||
this.props.onPressOut && this.props.onPressOut(e);
|
||||
this._dispatchPressedStateChange(false);
|
||||
},
|
||||
|
||||
touchableHandlePress: function() {
|
||||
this.props.onPress && this.props.onPress();
|
||||
touchableHandlePress: function(e: Event) {
|
||||
this.props.onPress && this.props.onPress(e);
|
||||
},
|
||||
|
||||
touchableHandleLongPress: function() {
|
||||
this.props.onLongPress && this.props.onLongPress();
|
||||
touchableHandleLongPress: function(e: Event) {
|
||||
this.props.onLongPress && this.props.onLongPress(e);
|
||||
},
|
||||
|
||||
touchableGetPressRectOffset: function() {
|
||||
|
|
Loading…
Reference in New Issue