TouchableWithoutFeedback onPress executes on touch release? - react-native

Rather than the onPress event triggering when a touch is pressed onto the TouchableWithoutFeedback component, it is triggered when a touch is released. Is this how the onPress event is supposed to work..?
Is there an event for the actual touch press rather than the touch release.

Yes, triggering the onPress event on release is the intended behavior.
You can use onPressIn if you want to trigger an action immediately when a button is clicked.

Related

React Native: How to response event in a overlay view and then pass through the event to next layer view

I have a bubble view. when someone tap outside of bubble, bubble will close, and then next layout will response event that listening.
explain image
I put the bubble on a modal view, when I tap i am a bubble, it will do something.
When I tap outside of bubble, bubble will close. If there are some component listening some event, just trigger it, as like there is no modal. For example, When I tap click me, the modal will be destroyed, and then the button event will trigger
What can I do, to implement it. Thanks a lot.

onLongPress triggers instead of onPress for single tap

I have a card item with TouchableOpacity which has both onPress and onLongPress. When I intend to perform onPress action by taping on the record onLongPress gets triggered. This is happening only when remote debugger is enabled. And this is happening both in emulator and real device.
Issue reported in github as well long back, but no solution as of now.
Any help is appreciated to prevent this behavior.Thank you.

React Native button release listener

I am writing a chat with audio messages. And I want to do something like in Whatsapp or other messengers. When user holds the button - program is recording the voice, when he releases - it stops and sends the message.
My question is how can I use Touchableopacity or Button and listen release event.
You can start recording in onPressIn prop of TouchableOpacity and and stop it in onPressOut prop of TouchableOpacity
The TouchableOpacity component has a prop called onPressOutin which you can pass a function to execute when the user releases the button.

React native onScroll ScrollView user event vs animation event

How can i can detect onScroll ScrollView event from a user vs an animation
in React Native the "onScroll" event is returned when a user makes a move and also when I move it using code

How to prevent React Native to dismiss keyboard

In a react-native form, when switching from one TextInput to the next one, the second grabs focus for an instant and then suddenly RN dismisses the keyboard.
I have onSubmitEditing coded to move to next input, but the user needs to click on enter in the keyboard, I can also override onEndEditing however that forces you to move to the next input and maybe you didn't touch that one.
I found out that the problem is related to having TextInputs within a ScrollView, focus between inputs in this component doesn't work as expected.
keyboardShouldPersistTaps={true} is deprecated so need to use keyboardShouldPersistTaps="always"