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

@@ -21,6 +21,7 @@ export default function ChangeSpeed() {
const [result, setResult] = useState<File | null>(null);
const compute = (optionsValues: typeof initialValues, input: File) => {
if (!input) return;
const { newSpeed } = optionsValues;
const processImage = async (file: File, newSpeed: number) => {
@@ -123,14 +124,14 @@ export default function ChangeSpeed() {
/>
<ToolOptions
compute={compute}
getGroups={({ values, setFieldValue }) => [
getGroups={({ values, updateField }) => [
{
title: 'New GIF speed',
component: (
<Box>
<TextFieldWithDesc
value={values.newSpeed}
onOwnChange={(val) => setFieldValue('newSpeed', val)}
onOwnChange={(val) => updateField('newSpeed', Number(val))}
description={'Default new GIF speed.'}
InputProps={{ endAdornment: <Typography>ms</Typography> }}
type={'number'}