diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index 3bbb58ec5..2ded46b1b 100644 --- a/Libraries/Components/WebView/WebView.android.js +++ b/Libraries/Components/WebView/WebView.android.js @@ -184,11 +184,18 @@ class WebView extends React.Component { 'always', 'compatibility' ]), + + /** + * Used on Android only, controls whether form autocomplete data should be saved + * @platform android + */ + saveFormDataDisabled: PropTypes.bool, }; static defaultProps = { javaScriptEnabled : true, scalesPageToFit: true, + saveFormDataDisabled: false }; state = { @@ -261,6 +268,7 @@ class WebView extends React.Component { mediaPlaybackRequiresUserAction={this.props.mediaPlaybackRequiresUserAction} allowUniversalAccessFromFileURLs={this.props.allowUniversalAccessFromFileURLs} mixedContentMode={this.props.mixedContentMode} + saveFormDataDisabled={this.props.saveFormDataDisabled} />; return ( diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java index ec3107f20..7e246a7ff 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java @@ -397,6 +397,11 @@ public class ReactWebViewManager extends SimpleViewManager { public void setAllowUniversalAccessFromFileURLs(WebView view, boolean allow) { view.getSettings().setAllowUniversalAccessFromFileURLs(allow); } + + @ReactProp(name = "saveFormDataDisabled") + public void setSaveFormDataDisabled(WebView view, boolean disable) { + view.getSettings().setSaveFormData(!disable); + } @ReactProp(name = "injectedJavaScript") public void setInjectedJavaScript(WebView view, @Nullable String injectedJavaScript) {