mirror of
https://github.com/zhigang1992/react-native-popover-view.git
synced 2026-01-12 17:42:41 +08:00
Fixing issue when isVisible is made false while the popover is animating in
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-popover-view",
|
||||
"version": "1.0.17",
|
||||
"version": "1.0.18",
|
||||
"description": "A <Popover /> component for react-native",
|
||||
"main": "src/index.js",
|
||||
"author": "Peter Steffey <steffeydev@icloud.com> (https://github.com/steffeydev)",
|
||||
|
||||
@@ -630,11 +630,17 @@ class Popover extends React.Component {
|
||||
}
|
||||
this.debug("componentWillReceiveProps - Awaiting popover show");
|
||||
} else {
|
||||
if (this.state.showing)
|
||||
this.animateOut();
|
||||
else
|
||||
if (this.state.visible) {
|
||||
if (this.state.showing)
|
||||
this.animateOut();
|
||||
else
|
||||
this.animateOutAfterShow = true;
|
||||
this.debug("componentWillReceiveProps - Hiding popover");
|
||||
}
|
||||
else {
|
||||
this.props.doneClosingCallback();
|
||||
this.debug("componentWillReceiveProps - Hiding popover");
|
||||
this.debug("componentWillReceiveProps - Popover never shown");
|
||||
}
|
||||
}
|
||||
} else if (willBeVisible) {
|
||||
this.calculateRect(nextProps, fromRect => {
|
||||
@@ -732,7 +738,13 @@ class Popover extends React.Component {
|
||||
scale: 1,
|
||||
translatePoint,
|
||||
easing: Easing.out(Easing.back()),
|
||||
callback: () => this.setState({showing: true})
|
||||
callback: () => {
|
||||
this.setState({showing: true});
|
||||
if (this.animateOutAfterShow) {
|
||||
this.animateOut();
|
||||
this.animateOutAfterShow = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user