react-native-web icon indicating copy to clipboard operation
react-native-web copied to clipboard

Unable to disable haptic feedback on Pressable's `onLongPress` event in Android Chrome

Open elliotwaite opened this issue 3 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the issue

When using Chrome on Android (or a Chormium-based browser on Android such as Edge or Brave (note: this does not occur in Firefox for Android)), if a Pressable component specifies an onLongPress callback, whenever that onLongPress event occurs, a short haptic feedback event also occurs. The haptic feedback seems to be the same haptic feedback that occurs when using a non-React site on Android Chrome and a long press is used to open a context menu.

Expected behavior

I expected the onLongPress event to not cause any haptic feedback, or for there to be an option to disable the haptic feedback.

Steps to reproduce

  1. In an Android Chrome browser, go to: https://codesandbox.io/s/pressable-press-and-hold-test-gdpc5e?file=/src/App.js
  2. Press and hold the button to trigger the onLongPress event and notice the haptic feedback.

Test case

https://codesandbox.io/s/pressable-press-and-hold-test-gdpc5e?file=/src/App.js

Additional comments

Discussion of this issue originated in this previous issue, which you can refer to for more context: Can't press and hold a Pressable on Android web

elliotwaite avatar Jul 26 '22 14:07 elliotwaite