Skip to content

Commit 72ef9da

Browse files
committed
docs: update docs
1 parent 1481d85 commit 72ef9da

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

docs/remove-context-share.mdx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,25 @@ title: Remove Context Menu
77

88
### Removing context menu on long-press:
99

10-
Use react-native's [Pressable API](https://reactnative.dev/docs/pressable) or any of the touchables to intercept long presses.
10+
Wrap the `<YoutubePlayer />` in a View that has `pointerEvents="none"` to disable app touch-events to the player.
1111

12-
example : (by [@vijay122](https://github.com/LonelyCpp/react-native-youtube-iframe/pull/111/files))
12+
Then react-native's [Pressable API](https://reactnative.dev/docs/pressable) or any of the touchables to intercept presses.
13+
14+
example:
1315

1416
```jsx
1517
<Pressable
18+
onPress={() => {
19+
// handle or ignore
20+
}}
1621
onLongPress={() => {
1722
// handle or ignore
1823
}}>
19-
<YoutubePlayer (...) />
24+
25+
<View pointerEvents="none">
26+
<YoutubePlayer (...) />
27+
</View>
28+
2029
</Pressable>
2130
```
2231

0 commit comments

Comments
 (0)