diff --git a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx index 877b2133c00..425041913f4 100644 --- a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx +++ b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx @@ -628,6 +628,21 @@ If you provided a React element for the optionText prop, you must also provide t ...params.InputProps, ...TextFieldProps?.InputProps, }; + // @ts-expect-error slotProps do not yet exist in MUI v5 + const mergedSlotProps = TextFieldProps?.slotProps + ? { + slotProps: { + // @ts-expect-error slotProps do not yet exist in MUI v5 + ...TextFieldProps?.slotProps, + input: { + readOnly, + ...params.InputProps, + // @ts-expect-error slotProps do not yet exist in MUI v5 + ...TextFieldProps?.slotProps?.input, + }, + }, + } + : undefined; return (