From 6ba24b1595eb1d91761a4c84f3a7f2c97e5c632a Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Thu, 11 Apr 2019 11:23:56 +0200 Subject: [PATCH] :bug: meilleure gestion de l'animation de Target --- source/components/TargetSelection.js | 14 +++++++++++--- source/components/ui/animate.js | 6 +++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/source/components/TargetSelection.js b/source/components/TargetSelection.js index 50f568652..ee4f100a0 100644 --- a/source/components/TargetSelection.js +++ b/source/components/TargetSelection.js @@ -50,6 +50,9 @@ export default compose( ) )( class TargetSelection extends PureComponent { + state = { + initialRender: true + } componentDidMount() { const props = this.props const targets = props.analysis ? props.analysis.targets : [] @@ -71,7 +74,10 @@ export default compose( : target.explanation?.defaultValue ) }) - props.setActiveInput(null) + + if (this.state.initialRender) { + this.setState({ initialRender: false }) + } } render() { let { colours, noUserInput, analysis } = this.props, @@ -129,6 +135,7 @@ export default compose( .map(target => ( { const isSmallTarget = !target.question || !target.formule || isEmpty(target.formule) + return (
  • - +
    { static defaultProps = { - alreadyPresent: false + unless: false } state = { - show: this.props.alreadyPresent + show: this.props.unless } componentDidMount() { window.setTimeout(() => this.setState({ show: true }), 0)