You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Long-press with a touch on a Pressable does not suppress the contextmenu on Windows. On iOS and Android, the contextmenu is triggered while the pointer is down, after a certain length of time. However, on Windows, the contextmenu is displayed after pointerup (with the same timestamp as pointerup), whether triggered by a mouse right-click or a touch long-press.
Use Responsive Design mode in Chrome dev tools and enable touch emulation.
Long press the Pressable and then release the pointer.
The contextmenu will display (with a type of PointerEvent, pointerType of touch, button value of -1, and the same timestamp as pointerup).
Expected behavior
No contextmenu should display if listening to longpress interaction. This can probably be fixed simply by calling preventDefault on all contextmenu events with a button value of -1 and/or pointerType of "touch" when onLongPress is defined.
Environment (include versions). Did this work in previous versions?
React Native for Web (version): 0.17 (all)
Browser: Browsers on Windows
The text was updated successfully, but these errors were encountered:
Long-press with a touch on a Pressable does not suppress the contextmenu
on Windows. On iOS and Android, the contextmenu is triggered while the
pointer is down, after a certain length of time. However, on Windows,
the contextmenu is displayed after pointerup (with the same timestamp as
pointerup), whether triggered by a mouse right-click or a touch
long-press.
Fixnecolas#2296Closenecolas#2316
The problem
Long-press with a touch on a Pressable does not suppress the contextmenu on Windows. On iOS and Android, the contextmenu is triggered while the pointer is down, after a certain length of time. However, on Windows, the contextmenu is displayed after pointerup (with the same timestamp as pointerup), whether triggered by a mouse right-click or a touch long-press.
How to reproduce
Simplified test case: https://6r9liu.sse.codesandbox.io/pressable (existing Pressable example)
Steps to reproduce:
touch
, button value of-1
, and the same timestamp aspointerup
).Expected behavior
No contextmenu should display if listening to longpress interaction. This can probably be fixed simply by calling preventDefault on all contextmenu events with a button value of
-1
and/orpointerType
of"touch"
whenonLongPress
is defined.Environment (include versions). Did this work in previous versions?
The text was updated successfully, but these errors were encountered: