Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
9f2585f
Delete v6 hook
LukasTy Mar 31, 2026
d28e3bf
Update core type definitions
LukasTy Apr 1, 2026
d211fd1
Simplify core hooks
LukasTy Apr 1, 2026
ee42e98
Update managers
LukasTy Apr 1, 2026
88d3026
Update exports
LukasTy Apr 1, 2026
e005479
Update components
LukasTy Apr 1, 2026
568276a
Further component updates
LukasTy Apr 1, 2026
51ea3cd
prettier
LukasTy Apr 1, 2026
73cae20
TS fixes
LukasTy Apr 1, 2026
f289980
Merge branch 'master' into fields-remove-accessible-dom-structure
LukasTy Apr 1, 2026
1d34471
Update docs
LukasTy Apr 2, 2026
65eddcf
docs:api
LukasTy Apr 2, 2026
d4c15f3
Update tests
LukasTy Apr 2, 2026
3587cf7
Cleanup proptypes
LukasTy Apr 2, 2026
bf36e5e
More test updates
LukasTy Apr 2, 2026
4d48638
Remove unused utils/assertions
LukasTy Apr 2, 2026
41d02d8
Extract error-codes
LukasTy Apr 2, 2026
1896736
Expand Agents responsibility around codemods
LukasTy Apr 2, 2026
27a5fd2
fix TS
LukasTy Apr 2, 2026
87056f2
Further expand agents responsibility towards codemods
LukasTy Apr 2, 2026
5da5f3e
Add codemod with tests
LukasTy Apr 2, 2026
0a40181
Add mentions in previous migration guides
LukasTy Apr 2, 2026
6a8e4ef
Align the now default props JSDoc
LukasTy Apr 2, 2026
bef9da9
proptypes
LukasTy Apr 2, 2026
1a9e7c3
More TS fixes
LukasTy Apr 2, 2026
cd7a93a
Simplify to pass `@default` presence validation
LukasTy Apr 2, 2026
5d08ae8
docs:api
LukasTy Apr 2, 2026
e501540
Remove unused parameters
LukasTy Apr 2, 2026
97d25f4
Code review: 1
LukasTy Apr 2, 2026
ca8d4cd
Code review: 2
LukasTy Apr 2, 2026
8a413cd
Code review: 3 - add a follow-up TODO
LukasTy Apr 2, 2026
17e60f6
Code review: 4 - inline the hook
LukasTy Apr 2, 2026
8e43ad6
Rename `expectFieldValueV7` to `expectFieldValue`
LukasTy Apr 2, 2026
d99dea9
Rename `v7Response` to `response`
LukasTy Apr 2, 2026
c807fe0
Rename demos
LukasTy Apr 2, 2026
98e35c4
Merge branch 'master' into fields-remove-accessible-dom-structure
LukasTy Apr 2, 2026
3cefe2a
docs:api
LukasTy Apr 2, 2026
9f202d7
Restructure migration page and add entry about types
LukasTy Apr 2, 2026
61b3b79
Fix build
LukasTy Apr 2, 2026
0423d8a
Merge branch 'master' into fields-remove-accessible-dom-structure
LukasTy Apr 2, 2026
b53e483
Remove no longer used files
LukasTy Apr 2, 2026
c0aa4a3
Remove unused files
LukasTy Apr 2, 2026
2ec0f72
Typo
LukasTy Apr 2, 2026
9dec4df
Optimization
LukasTy Apr 2, 2026
3ccd6ef
Revert "Remove unused files"
LukasTy Apr 2, 2026
d0e2274
Rename demo files
LukasTy Apr 2, 2026
8956c17
More renames
LukasTy Apr 2, 2026
305c36d
Copilot review
LukasTy Apr 3, 2026
72e1421
Code review: Copilot - Remove `| TextFieldProps` support
LukasTy Apr 3, 2026
fe2c527
Nitpick cleanup
LukasTy Apr 6, 2026
91bb00a
Code review: Flavien
LukasTy Apr 6, 2026
2582084
Merge branch 'master' into fields-remove-accessible-dom-structure
LukasTy Apr 6, 2026
5a270d3
proptypes
LukasTy Apr 6, 2026
f111033
docs:api
LukasTy Apr 6, 2026
4ff4a73
whoops - brainfart
LukasTy Apr 6, 2026
e2c5242
Remove redundant tests
LukasTy Apr 6, 2026
47d7225
merge-fail
LukasTy Apr 6, 2026
16842ae
Merge branch 'master' into fields-remove-accessible-dom-structure
LukasTy Apr 6, 2026
01f48d5
Revert another merge failure
LukasTy Apr 6, 2026
4c9342f
Code review: enhancement
LukasTy Apr 6, 2026
31307b2
nitpicks
LukasTy Apr 6, 2026
619cb16
lint
LukasTy Apr 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ To generate `.js` files, run `pnpm docs:typescript:formatted`.

Codemods are run by consumers of the MUI X libraries to migrate to newer versions of the libraries.

When adding a new codemod, make sure to also document it in the `packages/x-codemod/README.md` following existing examples.
You also need to create or expand the `preset-safe` preset to include the new codemod, document the preset in the `README.md` and also include the newly added changes to the `preset-safe` test.

### Versioning

When creating codemods, the code should be created in the directory of the target version. E.g., a codemod to migrate from v8 to v9 should be placed inside the `v9.0.0` directory.
Expand Down
Comment thread
LukasTy marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ function BrowserDateField(props) {
const fieldResponse = useDateField(props);

const {
// Should be ignored
enableAccessibleFieldDOMStructure,
// Should be passed to the PickersSectionList component
elements,
sectionListRef,
Expand Down Expand Up @@ -118,7 +116,7 @@ function BrowserDatePicker(props) {
);
}

export default function BrowserV7Field() {
export default function BrowserField() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<BrowserDatePicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@ const BrowserIconButton = styled('button', {
});

function BrowserDateField(props: DatePickerFieldProps) {
const fieldResponse = useDateField<true, typeof props>(props);
const fieldResponse = useDateField<typeof props>(props);

const {
// Should be ignored
enableAccessibleFieldDOMStructure,

// Should be passed to the PickersSectionList component
elements,
sectionListRef,
Expand Down Expand Up @@ -128,7 +125,7 @@ function BrowserDatePicker(props: DatePickerProps) {
);
}

export default function BrowserV7Field() {
export default function BrowserField() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<BrowserDatePicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const BrowserFieldContent = styled('div', { name: 'BrowserField', slot: 'Content

function BrowserTextField(props) {
const {
// Should be ignored
enableAccessibleFieldDOMStructure,
// Should be passed to the PickersSectionList component
elements,
sectionListRef,
Expand Down Expand Up @@ -127,7 +125,7 @@ function BrowserDateRangePicker(props) {
);
}

export default function BrowserV7MultiInputRangeField() {
export default function BrowserMultiInputRangeField() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<BrowserDateRangePicker />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,13 @@ const BrowserFieldContent = styled('div', { name: 'BrowserField', slot: 'Content
);

interface BrowserTextFieldProps extends UseMultiInputRangeFieldTextFieldProps<
true,
React.HTMLAttributes<HTMLDivElement>
> {
triggerRef?: React.Ref<HTMLDivElement>;
}

function BrowserTextField(props: BrowserTextFieldProps) {
const {
// Should be ignored
enableAccessibleFieldDOMStructure,

// Should be passed to the PickersSectionList component
elements,
sectionListRef,
Expand Down Expand Up @@ -161,7 +157,7 @@ function BrowserDateRangePicker(props: DateRangePickerProps) {
);
}

export default function BrowserV7MultiInputRangeField() {
export default function BrowserMultiInputRangeField() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<BrowserDateRangePicker />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ function BrowserSingleInputDateRangeField(props) {
const fieldResponse = useSingleInputDateRangeField(props);

const {
// Should be ignored
enableAccessibleFieldDOMStructure,
// Should be passed to the PickersSectionList component
elements,
sectionListRef,
Expand Down Expand Up @@ -129,7 +127,7 @@ function BrowserSingleInputDateRangePicker(props) {
);
}

export default function BrowserV7SingleInputRangeField() {
export default function BrowserSingleInputRangeField() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<BrowserSingleInputDateRangePicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,9 @@ interface BrowserSingleInputDateRangeFieldProps extends DateRangePickerFieldProp
function BrowserSingleInputDateRangeField(
props: BrowserSingleInputDateRangeFieldProps,
) {
const fieldResponse = useSingleInputDateRangeField<true, typeof props>(props);
const fieldResponse = useSingleInputDateRangeField<typeof props>(props);

const {
// Should be ignored
enableAccessibleFieldDOMStructure,

// Should be passed to the PickersSectionList component
elements,
sectionListRef,
Expand Down Expand Up @@ -143,7 +140,7 @@ function BrowserSingleInputDateRangePicker(props: DateRangePickerProps) {
);
}

export default function BrowserV7SingleInputRangeField() {
export default function BrowserSingleInputRangeField() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<BrowserSingleInputDateRangePicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const MyPickersTextField = React.forwardRef((props, ref) => (
<PickersTextField {...props} ref={ref} size="small" />
));

export default function MaterialV7FieldWrapped() {
export default function MaterialFieldWrapped() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DemoContainer components={['DateField', 'DatePicker']}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const MyPickersTextField = React.forwardRef(
),
);

export default function MaterialV7FieldWrapped() {
export default function MaterialFieldWrapped() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DemoContainer components={['DateField', 'DatePicker']}>
Expand Down
16 changes: 0 additions & 16 deletions docs/data/date-pickers/custom-field/MaterialV6Field.js

This file was deleted.

16 changes: 0 additions & 16 deletions docs/data/date-pickers/custom-field/MaterialV6Field.tsx

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import {
} from '@mui/x-date-pickers-pro/MultiInputDateRangeField';
import { DemoContainer } from '@mui/x-date-pickers/internals/demo';

function WrappedMultiInputDateRangeField(
props: MultiInputDateRangeFieldProps<true>,
) {
function WrappedMultiInputDateRangeField(props: MultiInputDateRangeFieldProps) {
return <MultiInputDateRangeField spacing={4} {...props} />;
}

Expand Down
19 changes: 4 additions & 15 deletions docs/data/date-pickers/custom-field/custom-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,14 @@ When used inside a picker, the `separator` slot is not available directly and mu

You can import the `PickersTextField` component to create custom wrappers:

{{"demo": "MaterialV7FieldWrapped.js"}}
{{"demo": "MaterialFieldWrapped.js"}}

:::success
This approach is only recommended if you need complex customizations on your `PickersTextField`.

If you just need to set some default props, you can use [the `slotProps` prop](/x/react-date-pickers/custom-field/#customize-the-textfield).
:::

### Using Material `TextField`

Pass the `enableAccessibleFieldDOMStructure={false}` to any Field or Picker component to use an `<input />` for the editing instead of the new accessible DOM structure:

{{"demo": "MaterialV6Field.js"}}

:::warning
The non-accessible DOM structure will be deprecated in a follow-up minor version and removed in `v9.x`.
If you are unable to migrate for some reason, please open an issue to describe what is missing from the new DOM structure so that we can improve it before dropping the old one.
:::

## With another Design System

### Using a custom input
Expand All @@ -100,11 +89,11 @@ You will have access to the `clearable` and `onClear` props using native HTML el
but the **focus** and **hover** behavior depends on styles applied via the `sx` prop.
:::

{{"demo": "BrowserV7Field.js", "defaultCodeOpen": false}}
{{"demo": "BrowserField.js", "defaultCodeOpen": false}}

{{"demo": "BrowserV7SingleInputRangeField.js", "defaultCodeOpen": false}}
{{"demo": "BrowserSingleInputRangeField.js", "defaultCodeOpen": false}}

{{"demo": "BrowserV7MultiInputRangeField.js", "defaultCodeOpen": false}}
{{"demo": "BrowserMultiInputRangeField.js", "defaultCodeOpen": false}}

## With a custom editing experience

Expand Down
2 changes: 1 addition & 1 deletion docs/data/date-pickers/fields/ImperativeClear.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function ImperativeClear() {
const endFieldRef = React.useRef<FieldRef<PickerValue>>(null);

const CustomMultiInputDateRangeField = React.useCallback(
(props: MultiInputDateRangeFieldProps<true>) => (
(props: MultiInputDateRangeFieldProps) => (
<MultiInputDateRangeField
{...props}
startFieldRef={startFieldRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ then you can look at the page to see all the examples improved and updated to us

#### Do not forward the `enableAccessibleFieldDOMStructure` prop to the DOM

:::info
The `enableAccessibleFieldDOMStructure` prop has been removed in v9. The accessible DOM structure is now the only supported option.
:::

The headless field hooks (for example `useDateField`) now return a new prop called `enableAccessibleFieldDOMStructure`.
This is used to know if the current UI expected is built using the accessible DOM structure or not.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ Starting with version `v8.x`, the new DOM structure is the default for all field

#### Fallback to the non-accessible DOM structure

:::info
The `enableAccessibleFieldDOMStructure` prop has been removed in v9. The accessible DOM structure is now the only supported option.
:::

```tsx
<DateField enableAccessibleFieldDOMStructure={false} />
<DatePicker enableAccessibleFieldDOMStructure={false} />
Expand Down
Loading
Loading