diff --git a/src/components/auth/PanelTransition.jsx b/src/components/auth/PanelTransition.jsx index 958005f..c98be2a 100644 --- a/src/components/auth/PanelTransition.jsx +++ b/src/components/auth/PanelTransition.jsx @@ -96,7 +96,7 @@ class PanelTransition extends Component { } render() { - const {canAnimateHeight, contextHeight, forceHeight} = this.state; + const {contextHeight, forceHeight} = this.state; const {Title, Body, Footer, Links} = this.props; @@ -111,6 +111,10 @@ class PanelTransition extends Component { const formHeight = this.state[`formHeight${panelId}`] || 0; + // a hack to disable height animation on first render + const isHeightMeasured = this.isHeightMeasured; + this.isHeightMeasured = formHeight > 0; + return ( { const heightKey = `formHeight${key}`; - // we need to skip first render, because there is no panel to make transition from - // const canAnimateHeight = Object.keys(this.state.height).length > 1 || this.state[heightKey]; - const canAnimateHeight = true; // NOTE: lets try to always animate - this.setState({ - canAnimateHeight, [heightKey]: height }); };