Skip to content

Commit 794b3bc

Browse files
[fields] Fix the error message when a custom field with an <input /> but the field expects the accessible DOM structure (#17237)
Signed-off-by: Flavien DELANGLE <[email protected]> Co-authored-by: Michel Engelen <[email protected]>
1 parent 6a85377 commit 794b3bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/x-date-pickers/src/internals/hooks/useField/useFieldV7TextField.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ export const useFieldV7TextField = <
206206
'MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`',
207207
'You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.',
208208
'',
209-
'If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your Picker or Field component:',
209+
'If you want to keep using an `<input />` HTML element for the editing, please add the `enableAccessibleFieldDOMStructure={false}` prop to your Picker or Field component:',
210210
'',
211-
'<DatePicker slots={{ textField: MyCustomTextField }} />',
211+
'<DatePicker enableAccessibleFieldDOMStructure={false} slots={{ textField: MyCustomTextField }} />',
212212
'',
213213
'Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element',
214214
].join('\n'),

0 commit comments

Comments
 (0)