Skip to content

Commit b348733

Browse files
committed
optimize anim
1 parent f71ee0d commit b348733

File tree

3 files changed

+5
-36
lines changed

3 files changed

+5
-36
lines changed

.npmignore

Lines changed: 0 additions & 29 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rc-dialog",
3-
"version": "5.0.2",
3+
"version": "5.0.3",
44
"description": "dialog ui component for react",
55
"keywords": [
66
"react",

src/Dialog.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@ const Dialog = React.createClass({
8181
}
8282
},
8383

84-
onAnimateEnd(key, visible) {
85-
if (!visible) {
86-
this.props.onAfterClose();
87-
}
84+
onAnimateLeave() {
85+
this.props.onAfterClose();
8886
},
8987

9088
onMaskClick() {
@@ -183,7 +181,7 @@ const Dialog = React.createClass({
183181
// add key for align to keep animate children stable
184182
return (<Animate key="dialog"
185183
showProp="dialogVisible"
186-
onEnd={this.onAnimateEnd}
184+
onLeave={this.onAnimateLeave}
187185
transitionName={transitionName}
188186
component=""
189187
transitionAppear={true}>
@@ -215,7 +213,7 @@ const Dialog = React.createClass({
215213
maskElement = <div {...maskProps} className={`${props.prefixCls}-mask`} key="mask"/>;
216214
if (maskTransition) {
217215
maskElement = (<Animate key="mask" showProp="data-visible" transitionAppear={true} component=""
218-
transitionName={maskTransition}>{maskElement}</Animate>);
216+
transitionName={maskTransition}>{maskElement}</Animate>);
219217
}
220218
}
221219
return maskElement;

0 commit comments

Comments
 (0)