File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments