Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<BR> `textInputProps={{autoCorrect:false}}` Currently supports:<BR>autoCorrect<BR>autoCapitalize<BR>clearButtonMode<BR>clearTextOnFocus <BR>keyboardType | Object (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>secureTextType<BR>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)
Expand Down
22 changes: 12 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '' });
}}>
}}>
<View style={[styles.container, {...modalStyleProps}]} >
<TouchableOpacity style={styles.container} activeOpacity={1} onPress={() => { this.props.closeDialog(); this.setState({ inputModal: '',openning: true })}} >
<View style={[styles.modal_container, {...dialogStyleProps}]} >
Expand All @@ -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}
/>
</View>
Expand Down Expand Up @@ -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)'
}
}),
},
Expand Down Expand Up @@ -156,7 +158,7 @@ const styles = StyleSheet.create({
backgroundColor: 'white',
borderRadius: 5,
paddingTop: 5,
borderWidth: 1,
borderWidth: 1,
borderColor: '#B0B0B0',
paddingBottom: 5,
paddingLeft: 10,
Expand Down Expand Up @@ -191,11 +193,11 @@ const styles = StyleSheet.create({
divider_btn:{
...Platform.select({
ios:{
width: 1,
width: 1,
backgroundColor: '#B0B0B0',
},
android:{
width: 0
width: 0
},
}),
},
Expand All @@ -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',
Expand All @@ -248,4 +250,4 @@ const styles = StyleSheet.create({
}),
},
});
export default DialogInput;
export default DialogInput;