React Native: Move button to finger position and immediately press without lifting finger

Viewed 226

I'm trying to create something where if a user long presses on the screen, a button appears at the position of the press (I know how to do this), and while the finger is still down, the button gets pressed. That is, I don't want the user to have to lift their finger after the button reaches their finger's position before they can press it.

Any thoughts on how this can be done, if at all? I need to be able to begin the onPress event of the button even before the onLongPress event of the screen has technically ended (I assume it ends once you release your finger)

2 Answers

Judging by the question it seems you are trying to make a button draggable without the button clicking. In order to do this note down the amount of time the button is held down for, if it exceeds a certain period of time, do not click.

//Sample code coming right up.
Related