react-native-modal-selector
Advanced tools
Comparing version 0.0.23 to 0.0.24
28
index.js
@@ -37,2 +37,3 @@ 'use strict'; | ||
sectionTextStyle: Text.propTypes.style, | ||
cancelContainerStyle: ViewPropTypes.style, | ||
cancelStyle: ViewPropTypes.style, | ||
@@ -61,2 +62,3 @@ cancelTextStyle: Text.propTypes.style, | ||
sectionTextStyle: {}, | ||
cancelContainerStyle: {}, | ||
cancelStyle: {}, | ||
@@ -86,6 +88,6 @@ cancelTextStyle: {}, | ||
this.state = { | ||
modalVisible: false, | ||
transparent: false, | ||
selected: 'please select', | ||
changedItem: undefined, | ||
modalVisible: false, | ||
transparent: false, | ||
selected: 'please select', | ||
changedItem: undefined, | ||
}; | ||
@@ -107,4 +109,4 @@ } | ||
if (Platform.OS === 'android' || !Modal.propTypes.onDismiss) { | ||
// RN >= 0.50 on iOS comes with the onDismiss prop for Modal which solves RN issue #10471 | ||
this.props.onChange(item) | ||
// RN >= 0.50 on iOS comes with the onDismiss prop for Modal which solves RN issue #10471 | ||
this.props.onChange(item); | ||
} | ||
@@ -124,3 +126,3 @@ this.setState({selected: item.label, changedItem: item }); | ||
modalVisible: true, | ||
changedItem: undefined, | ||
changedItem: undefined, | ||
}); | ||
@@ -141,3 +143,3 @@ } | ||
<View style={[styles.optionStyle, this.props.optionStyle, isLastItem && | ||
{borderBottomWidth: 0}]}> | ||
{borderBottomWidth: 0}]}> | ||
<Text style={[styles.optionTextStyle,this.props.optionTextStyle]}>{option.label}</Text> | ||
@@ -149,3 +151,3 @@ </View> | ||
renderOptionList() { | ||
let options = this.props.data.map((item, index) => { | ||
@@ -157,7 +159,9 @@ if (item.section) { | ||
}); | ||
const closeOverlay = this.props.backdropPressToClose; | ||
return ( | ||
<TouchableWithoutFeedback key={'modalSelector' + (componentIndex++)} onPress={() => {closeOverlay && this.close()}}> | ||
<TouchableWithoutFeedback key={'modalSelector' + (componentIndex++)} onPress={() => { | ||
closeOverlay && this.close(); | ||
}}> | ||
<View style={[styles.overlayStyle, this.props.overlayStyle]}> | ||
@@ -171,3 +175,3 @@ <View style={[styles.optionContainer, this.props.optionContainerStyle]}> | ||
</View> | ||
<View style={styles.cancelContainer}> | ||
<View style={[styles.cancelContainer, this.props.cancelContainerStyle]}> | ||
<TouchableOpacity onPress={this.close}> | ||
@@ -174,0 +178,0 @@ <View style={[styles.cancelStyle, this.props.cancelStyle]}> |
{ | ||
"name": "react-native-modal-selector", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "A cross-platform (iOS / Android), selector/picker component for React Native that is highly customizable and supports sections.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,4 +28,2 @@ 'use strict'; | ||
cancelContainer: { | ||
flexGrow: 1, | ||
maxHeight: 30, | ||
alignSelf: 'stretch', | ||
@@ -32,0 +30,0 @@ }, |
Sorry, the diff of this file is not supported yet
27512
262