diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index 3bbb58ec5c43e0..2ded46b1b8e655 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 ec3107f2039829..7e246a7ff68f47 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 void setMediaPlaybackRequiresUserAction(WebView view, boolean requires) { 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) {