When tapping on a view with "touchEnabled" set to false, the parent will wrongly fire a "longpress" event if it has a listener set up on it. That is, it fires when you're not actually long pressing it and should be a click instead. This issue does not happen if "touchEnabled" is set to true.
Steps to reproduce:
- Build and run the below on Android.
- Tap on the "Click Me" label.
- Notice you get a dialog displaying "click". (This is good.)
- Notice you also get a dialog displaying "longpress". (This is the bug.)
We're running into the same issue mentioned here...
The issue is that Google's GestureDetector sends a "longpress" message via a timeout which doesn't get canceled since the touch event isn't handled. The solution may be to implement our own custom long press event handling.
A "longpress" event should also cause the device to vibrate like how the native "longclick" works. This would match the behavior seen in Google's apps. The vibration should only happen if an event listener has been added for it.