react-native-modal
Advanced tools
Comparing version 5.1.1 to 5.2.0
{ | ||
"name": "react-native-modal", | ||
"version": "5.1.1", | ||
"version": "5.2.0", | ||
"description": "An enhanced React-Native modal", | ||
@@ -48,3 +48,3 @@ "main": "src/index.js", | ||
"*.js": [ | ||
"lint", | ||
"eslint src", | ||
"prettier --write", | ||
@@ -51,0 +51,0 @@ "git add" |
@@ -19,2 +19,3 @@ declare module "react-native-modal" { | ||
children: ReactNode; | ||
hideModalContentWhileAnimating?: boolean; | ||
isVisible: boolean; | ||
@@ -21,0 +22,0 @@ onModalShow?: () => void; |
@@ -200,3 +200,3 @@ import React, { Component } from "react"; | ||
this.props.backdropTransitionInTiming | ||
); | ||
); | ||
} | ||
@@ -287,3 +287,2 @@ Animated.spring(this.state.pan, { | ||
// This is for reset the pan position, if not modal get stuck | ||
@@ -336,9 +335,12 @@ // at the last release position when you try to open it. | ||
} else { | ||
this.setState({ | ||
showContent: false | ||
}, () => { | ||
this.setState({ | ||
isVisible: false | ||
}) | ||
}); | ||
this.setState( | ||
{ | ||
showContent: false | ||
}, | ||
() => { | ||
this.setState({ | ||
isVisible: false | ||
}); | ||
} | ||
); | ||
this.props.onModalHide(); | ||
@@ -384,3 +386,10 @@ } | ||
const _children = this.props.hideModalContentWhileAnimating && this.props.useNativeDriver &&!this.state.showContent ? <View /> : children; | ||
const _children = | ||
this.props.hideModalContentWhileAnimating && | ||
this.props.useNativeDriver && | ||
!this.state.showContent ? ( | ||
<View /> | ||
) : ( | ||
children | ||
); | ||
const containerView = ( | ||
@@ -414,3 +423,5 @@ <View | ||
{ | ||
backgroundColor: this.state.showContent ? backdropColor : 'transparent', | ||
backgroundColor: this.state.showContent | ||
? backdropColor | ||
: "transparent", | ||
width: deviceWidth, | ||
@@ -417,0 +428,0 @@ height: deviceHeight |
28653
475