🐛 répare les suggestions
parent
f9e6d2e834
commit
039d65d818
|
@ -7,7 +7,7 @@ import withLanguage from 'Components/utils/withLanguage'
|
|||
import withSitePaths from 'Components/utils/withSitePaths'
|
||||
import { encodeRuleName } from 'Engine/rules'
|
||||
import { compose, isEmpty, isNil, propEq } from 'ramda'
|
||||
import React, { Component, PureComponent } from 'react'
|
||||
import React, { Component, PureComponent, useState } from 'react'
|
||||
import { withTranslation } from 'react-i18next'
|
||||
import { connect } from 'react-redux'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
@ -173,6 +173,7 @@ const Target = ({
|
|||
}) => {
|
||||
const isSmallTarget =
|
||||
!target.question || !target.formule || isEmpty(target.formule)
|
||||
const [suggestionValue, setSuggestionValue] = useState(null)
|
||||
|
||||
return (
|
||||
<li
|
||||
|
@ -198,6 +199,7 @@ const Target = ({
|
|||
/>
|
||||
)}
|
||||
<TargetInputOrValue
|
||||
key={suggestionValue}
|
||||
{...{
|
||||
target,
|
||||
targets,
|
||||
|
@ -212,9 +214,10 @@ const Target = ({
|
|||
<Animate.fromTop>
|
||||
<InputSuggestions
|
||||
suggestions={target.suggestions}
|
||||
onFirstClick={value =>
|
||||
onFirstClick={value => {
|
||||
setFormValue(target.dottedName, '' + value)
|
||||
}
|
||||
setSuggestionValue(value)
|
||||
}}
|
||||
rulePeriod={target.période}
|
||||
colouredBackground={true}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue