-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Dialog: Animate when opening and closing #530
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor feedback/questions. Awesome to see this.
}; | ||
} | ||
|
||
public componentDidMount() { | ||
if (this.state.isOpen) { | ||
this._async.setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possible to use onAnimationEnd
event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was copied over from Panel.tsx but it's redundant in this case. I've removed it, so we're just using onAnimationEnd
now.
@@ -120,4 +166,33 @@ export class Dialog extends React.Component<IDialogProps, any> { | |||
|
|||
return groupings; | |||
} | |||
|
|||
private _onDialogRef(ref: HTMLDivElement) { | |||
if (ref) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use onAnimationEnd in react 15+?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the onAnimationEnd
handler was added for React 15. Here's the pull request.
* Animate the Dialog in * Animate the Dialog out * Remove unnecessary timeout and add clarifying comments
Fixes #86
This PR adds a fade in animation when the Dialog is opened, and a fadeOut animation when it's closed.