From 574cc367ebcce4a1f9c072a74cb070a4a1c39370 Mon Sep 17 00:00:00 2001 From: Caroline Jeandat Date: Wed, 12 Aug 2026 09:58:30 +0200 Subject: [PATCH] Fix MUI v7 upgrade --- src/components/dialogs/field-hook.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/dialogs/field-hook.tsx b/src/components/dialogs/field-hook.tsx index 2eaf1b91c..2e8c20b53 100644 --- a/src/components/dialogs/field-hook.tsx +++ b/src/components/dialogs/field-hook.tsx @@ -42,7 +42,7 @@ export const useTextValue = ({ setHasChanged(true); }, []); - const { input: slotPropsInput, formHelperText: slotPropsFormHelperText, ...slotProps } = formProps?.slotProps ?? {}; + const { slotProps, ...otherFormProps } = formProps; const field = useMemo( () => ( @@ -54,21 +54,19 @@ export const useTextValue = ({ value={value} style={{ width: '100%' }} onChange={handleChangeValue} - {...formProps} + {...otherFormProps} slotProps={{ + formHelperText: { + sx: styles.helperText, + }, ...slotProps, input: { - ...slotPropsInput, endAdornment: adornment, }, - formHelperText: { - sx: styles.helperText, - ...slotPropsFormHelperText, - }, }} /> ), - [id, label, value, handleChangeValue, formProps, slotProps, slotPropsInput, adornment, slotPropsFormHelperText] + [id, label, value, handleChangeValue, otherFormProps, slotProps, adornment] ); useEffect(() => setValue(defaultValue), [defaultValue]);