From 3d85f0408793cf52c8d597acf931c177f2004aff Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kaiser Date: Thu, 19 Jun 2025 16:12:53 +0200 Subject: [PATCH] Fix `` should not break when overriding input slot props --- .../src/input/AutocompleteInput.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 (