Skip to content

Commit

Permalink
added maxLength to input
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramananda Panda committed Aug 21, 2018
1 parent 2d8c639 commit c7aa039
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import DialogInput from 'react-native-dialog-input';
title | Title to show in the DialogInput | String (OPTIONAL)
message | Message to show in the DialogInput | String (OPTIONAL)
multiline | To make DialogInput multiline | Boolean (OPTIONAL)
maxLength | Limits the maximum number of characters that can be entered in the DialogInput<br> default values: if multiline, 200 else 50 | Number (OPTIONAL)
hintInput | Text hint to show in the TextInput | String (OPTIONAL)
textInputProps | Additional properties to add to the TextInput in the form:<BR> `textInputProps={{autoCorrect:false}}` Currently supports:<BR>autoCorrect<BR>autoCapitalize<BR>clearButtonMode<BR>clearTextOnFocus <BR>keyboardType <BR>required | Object (OPTIONAL)
modalStyle | Styles for the blocking view behind the DialogInput | Object (OPTIONAL)
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class DialogInput extends React.Component{
<Text style={[this.props.message ? styles.message_modal : {height:0} ]}>{this.props.message}</Text>
<TextInput style={styles.input_container}
multiline={(textProps && textProps.multiline)?true:false}
maxLength = {(textProps && textProps.maxLength) ? textProps.maxLength : (textProps.multiline ? 200 : 50)}
autoCorrect={(textProps && textProps.autoCorrect==false)?false:true}
autoCapitalize={(textProps && textProps.autoCapitalize)?textProps.autoCapitalize:'none'}
clearButtonMode={(textProps && textProps.clearButtonMode)?textProps.clearButtonMode:'never'}
Expand Down

0 comments on commit c7aa039

Please sign in to comment.