-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't press and hold a Pressable on Android web #2349
Comments
I think what's happening is that you are long-touching, and that triggers a https://codesandbox.io/s/clever-herschel-2z09xj?file=/src/App.js This does get me wondering a bit about the relationship between A touch-type |
Got it. Thanks for the solution and the explanation. And that's an interesting observation about the relationship between I noticed that after adding |
You should be able to set both those CSS properties on your pressable element. |
I've tried setting the CSS properties that were mentioned in that StackOverflow discussion, but they didn't seem to remove the haptic feedback (demo). It was more the Do you have any other suggestions for things I could try? |
No other suggestions. Until now I wasn't aware that browsers didn't cancel the haptic feedback along with the rest of the default behaviour. The pressable callbacks are built on the responder system abstraction, which depends on touch events but doesn't alter their propagation or expose them for further modification. Having said that, it sounds like this might be an issue that we could/should fix somewhere in this chain of abstractions rather than in your product code. |
Okay, got it. Since your suggestion of adding Thanks again for helping me resolve the original issue. |
Is there an existing issue for this?
Describe the issue
On Android web, when you press and hold a Pressable, it automatically calls its onPressOut callback after only a short delay, even if the Pressable is still being pressed, making it impossible to press and hold a Pressable for an extended amount of time.
Expected behavior
I expected the Pressable to call its onPressOut callback only after it is no longer being pressed.
Steps to reproduce
https://snack.expo.dev/@elliotwaite/press-and-hold-test
Test case
https://snack.expo.dev/@elliotwaite/press-and-hold-test
Additional comments
Here's an animated gif of a recording of what happens:

I wasn't sure if this was an issue with react-native-web or something else. So let me know if there would be a better place for me to open an issue about this.
The text was updated successfully, but these errors were encountered: