From f3507f99f18f8a26d67289fbad4d52e1f15a294c Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Mon, 6 Jun 2016 10:07:28 -0700 Subject: [PATCH] Remove support for password property and only use secureTextEntry Summary: Reduce the public surface area of TextInput. It only exposes a secureTextEntry property, but on Android was also accepting password as a prop. This removes that. Reviewed By: javache Differential Revision: D3392223 fbshipit-source-id: 67c36fbe16fe493e2841d5d9deb78e3be2209ebd --- Libraries/Components/TextInput/TextInput.js | 2 +- ReactAndroid/src/androidTest/js/TextInputTestModule.js | 4 ++-- .../react/views/textinput/ReactTextInputManager.java | 4 ++-- .../react/views/textinput/ReactTextInputPropertyTest.java | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 00e928bb9..7845ddd8e 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -557,9 +557,9 @@ var TextInput = React.createClass({ onSubmitEditing={this.props.onSubmitEditing} blurOnSubmit={this.props.blurOnSubmit} onLayout={this.props.onLayout} - password={this.props.password || this.props.secureTextEntry} placeholder={this.props.placeholder} placeholderTextColor={this.props.placeholderTextColor} + secureTextEntry={this.props.secureTextEntry} selectionColor={this.props.selectionColor} text={this._getText()} underlineColorAndroid={this.props.underlineColorAndroid} diff --git a/ReactAndroid/src/androidTest/js/TextInputTestModule.js b/ReactAndroid/src/androidTest/js/TextInputTestModule.js index d4e7cc0da..9ce284486 100644 --- a/ReactAndroid/src/androidTest/js/TextInputTestModule.js +++ b/ReactAndroid/src/androidTest/js/TextInputTestModule.js @@ -90,7 +90,7 @@ var TextInputTestApp = React.createClass({ autoFocus={true} keyboardType='numeric' multiline={true} - password={true} + secureTextEntry={true} defaultValue="This is text" testID="textInput1" /> @@ -101,7 +101,7 @@ var TextInputTestApp = React.createClass({ autoFocus={false} keyboardType='default' multiline={false} - password={false} + secureTextEntry={false} placeholder='1234' testID="textInput2" /> diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index 5564580ed..d8d835dab 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -394,8 +394,8 @@ public class ReactTextInputManager extends BaseViewManager