fix: formik updateField

This commit is contained in:
Ibrahima G. Coulibaly
2024-06-27 21:52:41 +01:00
parent da93452bd3
commit ac63c0e357
10 changed files with 89 additions and 58 deletions

View File

@@ -116,7 +116,7 @@ export default function SplitText() {
/>
<ToolOptions
compute={computeExternal}
getGroups={({ values, setFieldValue }) => [
getGroups={({ values, updateField }) => [
{
title: 'Split separator options',
component: splitOperators.map(({ title, description, type }) => (
@@ -127,8 +127,8 @@ export default function SplitText() {
fieldName={'splitSeparatorType'}
description={description}
value={values[`${type}Value`]}
onRadioClick={() => setFieldValue('splitSeparatorType', type)}
onTextChange={(val) => setFieldValue(`${type}Value`, val)}
onRadioClick={() => updateField('splitSeparatorType', type)}
onTextChange={(val) => updateField(`${type}Value`, val)}
/>
))
},
@@ -138,7 +138,7 @@ export default function SplitText() {
<TextFieldWithDesc
key={option.accessor}
value={values[option.accessor]}
onOwnChange={(value) => setFieldValue(option.accessor, value)}
onOwnChange={(value) => updateField(option.accessor, value)}
description={option.description}
/>
))