diff --git a/source/components/Simulateur.js b/source/components/Simulateur.js index 8832af9c1..700a6c22b 100644 --- a/source/components/Simulateur.js +++ b/source/components/Simulateur.js @@ -112,6 +112,7 @@ export default class extends Component { step={step} situationGate={situationGate} fieldName={fieldName} + inverted={step.name !== fieldName} /> ) } diff --git a/source/components/conversation/FormDecorator.js b/source/components/conversation/FormDecorator.js index 5d74010c8..657b287fe 100644 --- a/source/components/conversation/FormDecorator.js +++ b/source/components/conversation/FormDecorator.js @@ -38,7 +38,8 @@ export var FormDecorator = formType => RenderField => /* Une étape déjà répondue est marquée 'folded'. Dans ce dernier cas, un résumé de la réponse est affiché */ unfolded, - fieldName + fieldName, + inverted } = this.props, { possibleChoice, // should be found in the question set theoritically, but it is used for a single choice question -> the question itself is dynamic and cannot be input as code, @@ -55,6 +56,7 @@ export var FormDecorator = formType => RenderField => */ let stepProps = { ...this.props.step, + inverted, //TODO hack, enables redux-form/CHANGE to update the form state before the traverse functions are run submit: () => setTimeout(() => stepAction('fold', fieldName), 1), setFormValue: (value, name=fieldName) => setFormValue(name, value) diff --git a/source/components/conversation/Input.js b/source/components/conversation/Input.js index 4517c302e..cc57bae2f 100644 --- a/source/components/conversation/Input.js +++ b/source/components/conversation/Input.js @@ -107,8 +107,11 @@ export default class Input extends Component { ) } renderSuggestions(themeColours) { - let { setFormValue, submit, suggestions, input } = this.props.stepProps - if (!suggestions) return null + let { setFormValue, submit, suggestions, input, name, inverted } = this.props.stepProps + + + + if (!suggestions || inverted) return null return (
suggestions: