[Android] TouchableNativeFeedback doesn't forward touch event
I came across this issue and after a little peek into the source code noticed that the presshandlers in TouchableNativeFeedback don't capture or pass on the touch event parameter. Compare:
TouchableOpacity.js:109
touchableHandlePress: function(e: Event) {
this.clearTimeout(this._hideTimeout);
this._opacityActive();
this._hideTimeout = this.setTimeout(
this._opacityInactive,
this.props.delayPressOut || 100
);
this.props.onPress && this.props.onPress(e);
}
to
TouchableNativeFeedback.js:152
touchableHandlePress: function() {
this.props.onPress && this.props.onPress();
},
That particular function in TouchableNativeFeedback hasn't been touched since RN for Android was first released so I was surprised to not see any issues (that I noticed) documenting this.
I can open up a PR but since this code is so old, relatively, I thought I'd ask first to see if there were any reasons why this wasn't done initially? Potential bugs, crashes etc.
FWIW, simply adding an e into the parameter list and the onPress function call correctly forwarded the touch event so I've got this working for my local use case
Sounds like a good idea, thank you for noticing this! Can you send a PR please and link to this issue so it gets closed once the PR is merged?