question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using onPress with hitslop does not work as expected

See original GitHub issue

Is this a bug report?

Yes.

Have you read the Contributing Guidelines?

Yes

Environment

  1. react-native -v: 0.48.2
  2. node -v: 7.7.2
  3. npm -v: 5.0.3

Then, specify:

  • Target Platform: ios and android
  • Development Operating System: MacOS Sierra 10.12.6
  • Build tools: Xcode 9 and android studio

Description

I’m using TouchableWithoutFeedback around a small view and since it’s small, I’m using hitslop to expand the touchable area. I’m calling a function using onPress but when I’m using hitslop, it actually becomes harder to touch when using a device – it works great when using an emulator which is why it doesn’t make sense to make a side snackio project for this.

I noticed that if you lightly touch the screen with minimal skin contact, it works fine but when you fat finger it, nothing works. I’m able to work around this by using onPressIn or onPressOut but prefer to use onPress for detecting a true onPress.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
stale[bot]commented, Jan 9, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

3reactions
WillyRamirezcommented, Jan 10, 2018

Still waiting for a fix for this…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatically handling hitSlop with React Hooks
Let's say the UI designer will update the assets and run the script to export them to the assets folder of the app,...
Read more >
React native TouchableOpacity onPress not working on Android
In my case on android, TouchableOpacity rendered away (which was expected as the position is not absolute) from the view(which has position ...
Read more >
TouchableWithoutFeedback - React Native
Do not use unless you have a very good reason. All elements that respond to press should have a visual feedback when touched....
Read more >
touchableopacity onpress not working android
touchableWithoutFeedback onPress and onPressOut function are not firing on Android specifically the Samsung Galaxy. This is working perfectly fine on IOS10.
Read more >
TouchableWithoutFeedback · React Native
Delay in ms, from the release of the touch, before onPressOut is called. Type, Required. number, No. disabled. If true, disable all ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found