-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
touchableWithoutFeedback onPress and onPressOut not firing on Android #10180
Comments
Also not working on Nexus 5x. Any ideas? Seems to be only android related. |
I've been having similar issues with I've fallen back to just using |
I found the following did not work with return (
<View style={styles.sceneContent}>
<ScrollView>
<TouchableOpacity
onPress={this.handlePersonPress.bind(this)}
>
<PersonHeading
photoUrl={this.state.person.photoUrl}
name={this.state.person.firstName}
/>
</TouchableOpacity>
<Image
style={{height: 250}}
source={{uri: this.props.photoUrl}}
/>
<View style={styles.eventContent}>
<Text style={[styles.h2, styles.centerText]}>{this.props.description}</Text>
<Text style={[styles.h3, styles.centerText]}>{this.props.location}</Text>
<Text style={[styles.centerText]}>{renderTime(this.props.startTime)}</Text>
<Text style={[styles.centerText]}>{renderTime(this.props.endTime)}</Text>
</View>
<View style={styles.scenePad}>
<Button
style={[styles.button, styles.backgroundBlue]}
>
Request to Join
</Button>
</View>
</ScrollView>
</View>
); I wonder if it has something to do with being nested within the I'll upgrade to the latest version and update this comment with the results. |
It is working for me today, maybe it was solved in more recent versions (tested on 0.41 on the android emulator). |
I've ran into this today, |
Any ideas on this? The onPressOut is still not firing only for Android. Working perfect on ios still. I'm now on RN 0.43 |
I found that So instead of <TouchableWithoutFeedback onPressIn={...} onPressOut={...} onPress={...}>
<MyCustomComponent />
</TouchableWithoutFeedback> I now use: <TouchableWithoutFeedback onPressIn={...} onPressOut={...} onPress={...}>
<View>
<MyCustomComponent />
</View>
</TouchableWithoutFeedback> |
Fixed my issue thanks @koenpunt . Kind of depressing though. |
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
It is not fixed (RN 0.49.3), unless "having to add a and then it works" is considered fixed. The only child my TouchableWithoutFeedback had is a custom Header extending Component. Adding a View works but ... why? |
yep. im having this issue right now. adding the view works but it messes up everything |
Problem is still there, solution still works. |
@hramos Reopen so issues can actually get fixed? |
Its not working. Problem is still there. |
@koenpunt approach worked for me. |
It's strange because I've made a component that renders a RN 0.49.5 |
Not working for me too even with a View component inside. |
Still not working on RN 0.53.0 |
I am sure any contributors already muted this issue so bumping it is pointless. Just use |
Okay I figured out the issue, it's that the component itself does not support proper styling and collapses around its child view. Not sure if that's by design or not (all other touchables are properly stylable), so I'll open an issue for it. |
You must put something into it to make it work, just put a
Using this component is like a nightmare. |
Yeah it's wildly inconsistent right now, it should be fixed so it behaves like other Touchables. |
Also ran into this - it's quite frustrating to have to include the additional gratuitous |
I have this issue also, using 0.54 |
For the record, it's not necessary to add an extra view, you just need to ensure that the props that TouchableWithoutFeedback injects into it's child component are passed down to the View inside your custom component. For example, your custom component might be something like this:
It's explained in #1352 |
Import TouchableWithoutFeedback from react-native instead of react-native-gesture-handler to solve Error: NativeViewGestureHandler must be used as a descendant of GestureHandlerRootView
Issue Description
touchableWithoutFeedback onPress and onPressOut function are not firing on Android specifically the Samsung Galaxy.
This is working perfectly fine on IOS10.
Steps to Reproduce / Code Snippets
Code snippet of using the onPressOut function
<TouchableWithoutFeedback onPressOut={ this.onStopRecording }>
Expected Results
function should fire on Android. Is working for IOS!
Additional Information
Operating System (macOS, Linux, or Windows?): OSX
The text was updated successfully, but these errors were encountered: