forked from react-native-webview/react-native-webview
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iOS): Suppress menu items (react-native-webview#3082)
- Loading branch information
1 parent
5676b94
commit 5cd324c
Showing
10 changed files
with
157 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React, { Component } from 'react'; | ||
import { View } from 'react-native'; | ||
|
||
import WebView from 'react-native-webview'; | ||
|
||
interface Props {} | ||
interface State {} | ||
|
||
const HTML = ` | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Context Menu</title> | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | ||
<meta name="viewport" content="width=320, user-scalable=no"> | ||
</head> | ||
<body> | ||
<p contenteditable autofocus> | ||
Select text to see the context menu. | ||
</p> | ||
</body> | ||
</html> | ||
` | ||
|
||
export default class NativeWebpage extends Component<Props, State> { | ||
state = {}; | ||
|
||
render() { | ||
return ( | ||
<View style={{ height: 400 }}> | ||
<WebView | ||
source={{ html: HTML }} | ||
style={{ width: '100%', height: '100%' }} | ||
onShouldStartLoadWithRequest={(event) => { | ||
console.log("onShouldStartLoadWithRequest", event); | ||
return true; | ||
}} | ||
onLoadStart={(event) => { | ||
console.log("onLoadStart", event.nativeEvent); | ||
}} | ||
suppressMenuItems={["cut", "copy", "paste", "replace", "bold", "italic", "underline", "select", "share", "lookup"]} | ||
/> | ||
</View> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters