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..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 })}} > @@ -48,10 +48,12 @@ class DialogInput extends React.Component{ 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} onKeyPress={() => this.setState({ openning: false })} underlineColorAndroid='transparent' placeholder={hintInput} - onChangeText={(inputModal) => this.setState({inputModal})} + onChangeText={(inputModal) => this.setState({ inputModal, openning: false })} value={value} /> @@ -89,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)' } }), }, @@ -156,7 +158,7 @@ const styles = StyleSheet.create({ backgroundColor: 'white', borderRadius: 5, paddingTop: 5, - borderWidth: 1, + borderWidth: 1, borderColor: '#B0B0B0', paddingBottom: 5, paddingLeft: 10, @@ -191,11 +193,11 @@ const styles = StyleSheet.create({ divider_btn:{ ...Platform.select({ ios:{ - width: 1, + width: 1, backgroundColor: '#B0B0B0', }, android:{ - width: 0 + width: 0 }, }), }, @@ -221,8 +223,8 @@ const styles = StyleSheet.create({ borderRightWidth: 5, borderColor: '#B0B0B0', padding: 10, - height: 48, - maxHeight: 48, + height: 48, + maxHeight: 48, }, android: { textAlign:'right', @@ -248,4 +250,4 @@ const styles = StyleSheet.create({ }), }, }); -export default DialogInput; \ No newline at end of file +export default DialogInput;