From 6afd15d6e276525eced4de9fd14ff8a97cd4d65e Mon Sep 17 00:00:00 2001 From: Thibault Lemesle Date: Mon, 26 Aug 2019 09:58:25 +0200 Subject: [PATCH 1/2] Add secureTextType & maxLength props for TextInput --- README.md | 2 +- index.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d771db7..ab9ce0b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ import DialogInput from 'react-native-dialog-input'; message | Message to show in the DialogInput | String (OPTIONAL) hintInput | Text hint to show in the TextInput | String (OPTIONAL) initValueTextInput | Default value for the TextInput | String (OPTIONAL) - textInputProps | Additional properties to add to the TextInput in the form:
`textInputProps={{autoCorrect:false}}` Currently supports:
autoCorrect
autoCapitalize
clearButtonMode
clearTextOnFocus
keyboardType | Object (OPTIONAL) + textInputProps | Additional properties to add to the TextInput in the form:
`textInputProps={{autoCorrect:false}}` Currently supports:
autoCorrect
autoCapitalize
clearButtonMode
clearTextOnFocus
keyboardType
secureTextType
maxLength | Object (OPTIONAL) modalStyle | Styles for the blocking view behind the DialogInput | Object (OPTIONAL) dialogStyle | Styles for the DialogInput main view | Object (OPTIONAL) cancelText | Replacement text for the Cancel button | String (OPTIONAL) diff --git a/index.js b/index.js index ec830ad..2b2a599 100644 --- a/index.js +++ b/index.js @@ -47,6 +47,8 @@ class DialogInput extends React.Component{ clearButtonMode={(textProps && textProps.clearButtonMode)?textProps.clearButtonMode:'never'} clearTextOnFocus={(textProps && textProps.clearTextOnFocus==true)?textProps.clearTextOnFocus:false} keyboardType={(textProps && textProps.keyboardType)?textProps.keyboardType:'default'} + secureTextEntry={(textProps && textProps.secureTextEntry)?textProps.secureTextEntry:false} + maxLength={(textProps && textProps.maxLength > 0)?textProps.maxLength:null} autoFocus={true} onKeyPress={() => this.setState({ openning: false })} underlineColorAndroid='transparent' From ba15aae0b764b0a62797682cb0a0570684aa503c Mon Sep 17 00:00:00 2001 From: Thibault Lemesle Date: Mon, 26 Aug 2019 10:01:01 +0200 Subject: [PATCH 2/2] change opacity --- index.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index 2b2a599..45a4ce7 100644 --- a/index.js +++ b/index.js @@ -31,10 +31,10 @@ class DialogInput extends React.Component{ animationType="fade" transparent={true} visible={this.props.isDialogVisible} - onRequestClose={() => { + onRequestClose={() => { this.props.closeDialog(); this.setState({ inputModal: '' }); - }}> + }}> { this.props.closeDialog(); this.setState({ inputModal: '',openning: true })}} > @@ -47,13 +47,13 @@ class DialogInput extends React.Component{ clearButtonMode={(textProps && textProps.clearButtonMode)?textProps.clearButtonMode:'never'} clearTextOnFocus={(textProps && textProps.clearTextOnFocus==true)?textProps.clearTextOnFocus:false} keyboardType={(textProps && textProps.keyboardType)?textProps.keyboardType:'default'} + autoFocus={true} secureTextEntry={(textProps && textProps.secureTextEntry)?textProps.secureTextEntry:false} maxLength={(textProps && textProps.maxLength > 0)?textProps.maxLength:null} - autoFocus={true} onKeyPress={() => this.setState({ openning: false })} underlineColorAndroid='transparent' placeholder={hintInput} - onChangeText={(inputModal) => this.setState({inputModal})} + onChangeText={(inputModal) => this.setState({ inputModal, openning: false })} value={value} /> @@ -91,7 +91,7 @@ const styles = StyleSheet.create({ alignItems: 'center', ...Platform.select({ android:{ - backgroundColor: 'rgba(0,0,0,0.62)' + backgroundColor: 'rgba(0,0,0,0)' } }), }, @@ -158,7 +158,7 @@ const styles = StyleSheet.create({ backgroundColor: 'white', borderRadius: 5, paddingTop: 5, - borderWidth: 1, + borderWidth: 1, borderColor: '#B0B0B0', paddingBottom: 5, paddingLeft: 10, @@ -193,11 +193,11 @@ const styles = StyleSheet.create({ divider_btn:{ ...Platform.select({ ios:{ - width: 1, + width: 1, backgroundColor: '#B0B0B0', }, android:{ - width: 0 + width: 0 }, }), }, @@ -223,8 +223,8 @@ const styles = StyleSheet.create({ borderRightWidth: 5, borderColor: '#B0B0B0', padding: 10, - height: 48, - maxHeight: 48, + height: 48, + maxHeight: 48, }, android: { textAlign:'right', @@ -250,4 +250,4 @@ const styles = StyleSheet.create({ }), }, }); -export default DialogInput; \ No newline at end of file +export default DialogInput;