Using onPress with hitslop does not work as expected
See original GitHub issueIs this a bug report?
Yes.
Have you read the Contributing Guidelines?
Yes
Environment
react-native -v
: 0.48.2node -v
: 7.7.2npm -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:
- Created 6 years ago
- Comments:12 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Still waiting for a fix for this…