Skip to content

Commit ff2a41d

Browse files
authored
Disable context menu on LongPressGestureHandler (#2257)
## Description This PR disables context menu on `LongPressGestureHandler`. It can become pretty annoying when there's image inside handler, because doing long press on image triggers default menu to pop up. ## Test plan Tested on example app
1 parent a6d83a1 commit ff2a41d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/web/handlers/LongPressGestureHandler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export default class LongPressGestureHandler extends GestureHandler {
2323
public init(ref: number, propsRef: React.RefObject<unknown>) {
2424
super.init(ref, propsRef);
2525
this.setShouldCancelWhenOutside(true);
26+
27+
this.view.oncontextmenu = () => false;
2628
}
2729

2830
protected transformNativeEvent() {

0 commit comments

Comments
 (0)