Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the shadow warning and make the backgroundView touchable #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 6 additions & 5 deletions Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var Popover = React.createClass({
propTypes: {
isVisible: PropTypes.bool,
onClose: PropTypes.func,
onBgPress:PropTypes.func
},
getInitialState() {
return {
Expand All @@ -59,6 +60,7 @@ var Popover = React.createClass({
arrowSize: DEFAULT_ARROW_SIZE,
placement: 'auto',
onClose: noop,
onBgPress:noop
};
},
measureContent(x) {
Expand Down Expand Up @@ -345,7 +347,9 @@ var Popover = React.createClass({
return (
<TouchableWithoutFeedback onPress={this.props.onClose}>
<View style={[styles.container, contentSizeAvailable && styles.containerVisible ]}>
<Animated.View style={[styles.background, ...extendedStyles.background]}/>
<TouchableWithoutFeedback onPress={this.props.onBgPress}>
<Animated.View style={[styles.background, ...extendedStyles.background]}/>
</TouchableWithoutFeedback>
<Animated.View style={[styles.popover, {
top: popoverOrigin.y,
left: popoverOrigin.x,
Expand All @@ -371,6 +375,7 @@ var styles = StyleSheet.create({
right: 0,
position: 'absolute',
backgroundColor: 'transparent',
zIndex:999
},
containerVisible: {
opacity: 1,
Expand All @@ -386,10 +391,6 @@ var styles = StyleSheet.create({
popover: {
backgroundColor: 'transparent',
position: 'absolute',
shadowColor: 'black',
shadowOffset: {width: 0, height: 2},
shadowRadius: 2,
shadowOpacity: 0.8,
},
content: {
borderRadius: 3,
Expand Down