Skip to content
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

onPress event does not always fire, while onPressIn and onPressOut work fine #18235

Closed
nxz91 opened this issue Mar 7, 2018 · 6 comments
Closed
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@nxz91
Copy link

nxz91 commented Mar 7, 2018

Environment

Environment:
OS: macOS High Sierra 10.13.3
Node: 6.10.0
Yarn: 1.3.2
npm: 3.10.10
Watchman: Not Found
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 1.5 AI-141.2456560

Packages: (wanted => installed)
react: ^16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: 0.54.0 => 0.54.0

Expected Behavior

When I press a collapsed item (TouchableWithoutFeedback or TouchableHighlight) in the list, or when I press above or below an expanded item, the onPress event should get fired at all times, resulting in the item expanding or collapsing. At the same time, it becomes a horizontal ScrollView and scrolling on the wrapping vertical ScrollView gets disabled.

Actual Behavior

When I press a collapsed item in the list, or when I press above or below an expanded item, the onPress event only gets fired occasionally, while onPressIn and onPressOut always fire. The issue was not reproducible in the simulator, but only on the actual device as well as in the Expo Snack that is attached.

Feels super weird :-)

Steps to Reproduce

https://snack.expo.io/@leonard91/bug-report

@nxz91
Copy link
Author

nxz91 commented Mar 7, 2018

Someone else seems to have had the issue before as well: #17577 I tried using ugly workarounds with onPressIn or onPressOut as well, but I could not make it work reliably as well.

As opposed to the poster of #17577, the first touch does not always work for me.

I was on 0.52.0 previously, and upgraded to see if it solves the issue. So the issue already existed back then.

@nxz91 nxz91 changed the title onPress event does not always fire, while onPressIn and onPressOut work fine onPress event on TouchableWithoutFeedback and TouchableHighlight does not always fire, while onPressIn and onPressOut work fine Mar 7, 2018
@nxz91 nxz91 changed the title onPress event on TouchableWithoutFeedback and TouchableHighlight does not always fire, while onPressIn and onPressOut work fine onPress event does not always fire, while onPressIn and onPressOut work fine Mar 7, 2018
@douglowder
Copy link
Contributor

@nxz91 just curious, did you try adding removeClippedSubviews={false} to your ScrollView?

@nxz91
Copy link
Author

nxz91 commented Mar 7, 2018

@dlowder-salesforce did it now, but that doesn't work either (see Expo Snack).

@kadoshms
Copy link

I can also confirm this issue.
In my case, I have a SectionList and a TouchableOpacity above it (inside a fixed header), and onPress is completly ignored while scrolling, while onPressIn works.

@junchenjun
Copy link

Same issue, and I am not even in the list, just a regular button on header, sometimes onPress() won't fire, onPressIn and out always fire though.

And I noticed the issue only happens on the left side, where also triggers a swipe back gesture, maybe has something to do with PanResponder??

@stale
Copy link

stale bot commented Aug 28, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 28, 2018
@nxz91 nxz91 closed this as completed Aug 31, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Sep 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

4 participants