Pas de suggestions pendant une inversion

L'idéal serait de calculer les valeurs inversées !
pull/138/head
mama 2017-11-23 18:36:00 +01:00
parent 6f75b94bba
commit 63eab021c1
3 changed files with 9 additions and 3 deletions

View File

@ -112,6 +112,7 @@ export default class extends Component {
step={step}
situationGate={situationGate}
fieldName={fieldName}
inverted={step.name !== fieldName}
/>
)
}

View File

@ -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)

View File

@ -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 (
<div className="inputSuggestions">
suggestions: