react-native-modal-selector
Advanced tools
Comparing version 1.1.0 to 1.1.1
20
index.js
@@ -247,8 +247,18 @@ 'use strict'; | ||
const closeOverlay = this.props.backdropPressToClose; | ||
let Overlay = View; | ||
let overlayProps = { | ||
style: {flex:1} | ||
}; | ||
// Some RN versions have a bug here, so making the property opt-in works around this problem | ||
if (this.props.backdropPressToClose) { | ||
Overlay = TouchableWithoutFeedback; | ||
overlayProps = { | ||
key: `modalSelector${componentIndex++}`, | ||
accessible: false, | ||
onPress: this.close | ||
}; | ||
} | ||
return ( | ||
<TouchableWithoutFeedback key={'modalSelector' + (componentIndex++)} accessible={false} onPress={() => { | ||
closeOverlay && this.close(); | ||
}}> | ||
<Overlay {...overlayProps}> | ||
<View style={[styles.overlayStyle, this.props.overlayStyle]}> | ||
@@ -270,3 +280,3 @@ <View style={[styles.optionContainer, this.props.optionContainerStyle]}> | ||
</View> | ||
</TouchableWithoutFeedback>); | ||
</Overlay>); | ||
} | ||
@@ -273,0 +283,0 @@ |
{ | ||
"name": "react-native-modal-selector", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"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", |
@@ -0,0 +0,0 @@ # react-native-modal-selector [](https://badge.fury.io/js/react-native-modal-selector) |
@@ -0,0 +0,0 @@ 'use strict'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
74985
9
376