Set a timeout to Terminal animation

If the animation has no effect, `onTransitionEnd`'s handler is not be called.
Since `onTransitionEnd`'s handler controls whether the terminal is shown or not (by passing `connect=true` as a Terminal prop), set the `animated` variable to true after a timeout.

Please see:
* https://stackoverflow.com/questions/2087510/callback-on-css-transition/11354026#11354026
* https://github.com/scttnlsn/backbone.viewkit/issues/4
* https://forums.xamarin.com/discussion/58456/why-isnt-my-transitionlistener-getting-called
This commit is contained in:
Roberto Bruggemann
2018-01-11 16:19:55 +00:00
parent f42e22098e
commit c00ab5e9e7

View File

@@ -17,9 +17,17 @@ class EmeddedTerminal extends React.Component {
}
componentDidMount() {
setTimeout(() => {
this.mountedTimeout = setTimeout(() => {
this.setState({mounted: true});
});
this.animationTimeout = setTimeout(() => {
this.setState({ animated: true });
}, 2000);
}
componentWillUnmount() {
clearTimeout(this.mountedTimeout);
clearTimeout(this.animationTimeout);
}
getTransform() {