🐛 Autofocus seulement si saisie en cours
Sans l'autofocus, il faut alors cliquer deux fois sur la ligne CA pour pouvoir l'éditer : 1) pour passer le CA d'une div à un input 2) pour commencer à éditer et donc afficher le clavierpull/540/head
parent
a92dd80935
commit
c50173a579
|
@ -267,31 +267,32 @@ let TargetInputOrValue = withLanguage(
|
|||
language,
|
||||
firstStepCompleted,
|
||||
inversionFail
|
||||
}) => (
|
||||
<span className="targetInputOrValue">
|
||||
{activeInput === target.dottedName ||
|
||||
!target.formule ||
|
||||
isEmpty(target.formule) ? (
|
||||
<Field
|
||||
name={target.dottedName}
|
||||
{...(target.formule ? { autoFocus: true } : {})}
|
||||
component={CurrencyField}
|
||||
language={language}
|
||||
/>
|
||||
) : (
|
||||
<TargetValue
|
||||
{...{
|
||||
targets,
|
||||
target,
|
||||
activeInput,
|
||||
setActiveInput,
|
||||
firstStepCompleted,
|
||||
inversionFail
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</span>
|
||||
)
|
||||
}) => {
|
||||
let inputIsActive = activeInput === target.dottedName
|
||||
return (
|
||||
<span className="targetInputOrValue">
|
||||
{inputIsActive || !target.formule || isEmpty(target.formule) ? (
|
||||
<Field
|
||||
name={target.dottedName}
|
||||
component={CurrencyField}
|
||||
{...(inputIsActive ? { autoFocus: true } : {})}
|
||||
language={language}
|
||||
/>
|
||||
) : (
|
||||
<TargetValue
|
||||
{...{
|
||||
targets,
|
||||
target,
|
||||
activeInput,
|
||||
setActiveInput,
|
||||
firstStepCompleted,
|
||||
inversionFail
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
const TargetValue = connect(
|
||||
|
|
Loading…
Reference in New Issue