@mui/x-date-pickers 8.11.3 → 8.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +151 -6
- package/DateTimePicker/shared.d.ts +1 -0
- package/DateTimePicker/shared.js +4 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +3 -1
- package/esm/DateTimePicker/shared.d.ts +1 -0
- package/esm/DateTimePicker/shared.js +4 -0
- package/esm/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -1
- package/esm/MobileDateTimePicker/MobileDateTimePicker.js +3 -1
- package/esm/index.js +1 -1
- package/esm/internals/components/PickerFieldUI.js +3 -0
- package/esm/internals/hooks/useField/useFieldState.js +3 -2
- package/index.js +1 -1
- package/internals/components/PickerFieldUI.js +3 -0
- package/internals/hooks/useField/useFieldState.js +3 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,151 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.12.0
|
|
9
|
+
|
|
10
|
+
_Sep 25, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🤝 Grid-Charts integration
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
👉 [🎥 Watch the full video](https://github.com/user-attachments/assets/28f1848e-dc85-4077-8756-a3e88afd4e54)
|
|
19
|
+
|
|
20
|
+
- ⌨️ Charts keyboard navigation
|
|
21
|
+
- ⚡️ Charts: Add new `renderer="svg-batch"` prop to Scatter charts that provides improved performance for large datasets
|
|
22
|
+
- 🐞 Bugfixes
|
|
23
|
+
- 📚 Documentation improvements
|
|
24
|
+
- 🧰 Codemod requires Node >=20.19
|
|
25
|
+
|
|
26
|
+
`@mui/x-codemod` minimum supported Node version is `20.19`.
|
|
27
|
+
This was only the case due to using the v18 `yargs` package; this now explicitly aligns with it. (#18979)
|
|
28
|
+
|
|
29
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
30
|
+
@deade1e, @sai6855, @thomas-mcdonald
|
|
31
|
+
|
|
32
|
+
The following are all team members who have contributed to this release:
|
|
33
|
+
@alexfauquette, @bernardobelchior, @flaviendelangle, @Janpot, @JCQuintas, @LukasTy, @michelengelen, @prakhargupta1, @rita-codes, @siriwatknp, @arminmeh, @romgrk
|
|
34
|
+
|
|
35
|
+
### Data Grid
|
|
36
|
+
|
|
37
|
+
#### `@mui/x-data-grid@8.12.0`
|
|
38
|
+
|
|
39
|
+
- [DataGrid] Fix flex column width diff calculation while resizing (#19667) @arminmeh
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-data-grid-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
42
|
+
|
|
43
|
+
Same changes as in `@mui/x-data-grid@8.12.0`.
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-data-grid-premium@8.12.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
46
|
+
|
|
47
|
+
Same changes as in `@mui/x-data-grid-pro@8.12.0`, plus:
|
|
48
|
+
|
|
49
|
+
- [DataGridPremium] Grid-Charts integration (#18021) @arminmeh
|
|
50
|
+
- [DataGridPremium] Fix sorting and filtering of the tree group columns with aggregation (#19607) @arminmeh
|
|
51
|
+
- [DataGridPremium] Disable aggregation on the grouping column by default (#19692) @arminmeh
|
|
52
|
+
- [DataGridPremium] Do not rely on the group separation constant to retrieve the column name for the charts panel (#19677) @arminmeh
|
|
53
|
+
- [DataGridPremium] Fix stale aggregation state (#19690) @arminmeh
|
|
54
|
+
- [DataGridPremium] Fix pivot column being hidden on autosizing (#19699) @cherniavskii
|
|
55
|
+
|
|
56
|
+
### Date and Time Pickers
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-date-pickers@8.12.0`
|
|
59
|
+
|
|
60
|
+
- [pickers] Ensure reference value is not updated for invalid values (#19635) @michelengelen
|
|
61
|
+
- [pickers] Fix `slotProps.textField.slotProps.htmlInput` resolution (#19713) @LukasTy
|
|
62
|
+
- [pickers] Preserve time format when using single column layout on Time Range Picker (#19626) @sai6855
|
|
63
|
+
- [pickers] Preserve time format when using single column layout on Date Time Picker and Date Time Range Picker (#19608) @sai6855
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-date-pickers-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
66
|
+
|
|
67
|
+
Same changes as in `@mui/x-date-pickers@8.12.0`.
|
|
68
|
+
|
|
69
|
+
### Charts
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-charts@8.12.0`
|
|
72
|
+
|
|
73
|
+
- [charts] Add batch renderer for scatter chart (#19075) @bernardobelchior
|
|
74
|
+
- [charts] Add renderer suffix to performance benchmarks (#19620) @bernardobelchior
|
|
75
|
+
- [charts] Document how plugins can be used (#19343) @alexfauquette
|
|
76
|
+
- [charts] Export chart plugins per series type (#19337) @alexfauquette
|
|
77
|
+
- [charts] Export plugins (#19335) @alexfauquette
|
|
78
|
+
- [charts] Fix horizontal layout and toolbar (#19655) @alexfauquette
|
|
79
|
+
- [charts] Fix performance issue with JS animations (#19606) @bernardobelchior
|
|
80
|
+
- [charts] Fix piecewise scale causing wrong colors in axis with min/max (#19610) @bernardobelchior
|
|
81
|
+
- [charts] Fix zoom discard inconsistency (#19535) @bernardobelchior
|
|
82
|
+
- [charts] Introduce keyboard navigation (#19155) @alexfauquette
|
|
83
|
+
- [charts] Refactor `getAxisExtremum` (#19627) @bernardobelchior
|
|
84
|
+
- [charts] Remove unused code path from `getAxisScale` (#19673) @bernardobelchior
|
|
85
|
+
- [charts] Make new hideLegend prop on ChartWrapper optional (#19694) @thomas-mcdonald
|
|
86
|
+
- [charts] Fix chart crash in test environment (#19711) @JCQuintas
|
|
87
|
+
|
|
88
|
+
#### `@mui/x-charts-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
89
|
+
|
|
90
|
+
Same changes as in `@mui/x-charts@8.12.0`, plus:
|
|
91
|
+
|
|
92
|
+
- [charts-pro] Add `valueFormatter` to sankey (#19636) @JCQuintas
|
|
93
|
+
- [charts-pro] Allow `source/target` keywords in sankey link color (#19634) @JCQuintas
|
|
94
|
+
- [charts-pro] Allow exporting `SankeyChart` (#19659) @JCQuintas
|
|
95
|
+
- [charts-pro] Fix axis inversion when using axis `max` and `filterMode: 'discard'` (#19200) @bernardobelchior
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-charts-premium@8.12.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
98
|
+
|
|
99
|
+
Same changes as in `@mui/x-charts-pro@8.12.0`, plus:
|
|
100
|
+
|
|
101
|
+
- [charts-premium] Grid-Charts integration (#18021) @arminmeh
|
|
102
|
+
|
|
103
|
+
### Tree View
|
|
104
|
+
|
|
105
|
+
#### `@mui/x-tree-view@8.12.0`
|
|
106
|
+
|
|
107
|
+
- [tree view] Allow to pass `null` to the icon slots (#19569) @flaviendelangle
|
|
108
|
+
- [tree view] Fix `apiRef.current.isItemExpanded()` method (#19619) @flaviendelangle
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-tree-view-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
111
|
+
|
|
112
|
+
Same changes as in `@mui/x-tree-view@8.12.0`.
|
|
113
|
+
|
|
114
|
+
### Codemod
|
|
115
|
+
|
|
116
|
+
#### `@mui/x-codemod@8.12.0`
|
|
117
|
+
|
|
118
|
+
- [codemod] Bump `engines.node` to `>=20.19` to align with `yargs` package (#18979) @LukasTy
|
|
119
|
+
|
|
120
|
+
### Docs
|
|
121
|
+
|
|
122
|
+
- [docs] Add missing label to Charts example (#19616) @prakhargupta1
|
|
123
|
+
- [docs] Replace axis type and axis data with a table (#19618) @prakhargupta1
|
|
124
|
+
- [docs] Add Charts example collection page (#18353) @prakhargupta1
|
|
125
|
+
- [docs] Add a Charts demo showcasing bar and scatter composition (#19605) @prakhargupta1
|
|
126
|
+
- [docs] Add composition Charts demo for legends and tooltip (#19602) @prakhargupta1
|
|
127
|
+
- [docs] Add recipe about server-side data export (#19617) @siriwatknp
|
|
128
|
+
- [docs] Clarify DataGrid layout requirements (#19413) @romgrk
|
|
129
|
+
- [docs] Fix `ExportServerSideData` demo layout shift (#19669) @siriwatknp
|
|
130
|
+
- [docs] Improve server-side `updateRow()` description (#19554) @deade1e
|
|
131
|
+
- [docs] Show how to customize drawing area background (#19682) @alexfauquette
|
|
132
|
+
- [docs] Add hook documentation pages (#19334) @Copilot
|
|
133
|
+
|
|
134
|
+
### Core
|
|
135
|
+
|
|
136
|
+
- [code-infra] Add copilot instructions specific to x repo (#19623) @JCQuintas
|
|
137
|
+
- [code-infra] Load `tsx` files in visual regression (#19595) @JCQuintas
|
|
138
|
+
- [code-infra] Remove renovate automerge (#19501) @Janpot
|
|
139
|
+
- [code-infra] Update `DEFAULT_TIMESTAMP` format to ISO 8601 (#19624) @Janpot
|
|
140
|
+
- [code-infra] Update `findLatestTaggedVersion` to filter tags based on major version (#19693) @michelengelen
|
|
141
|
+
- [code-infra] Fix changelog generation for charts premium (#19701) @JCQuintas
|
|
142
|
+
- [code-infra] Run prettier on `createReleasePR.mjs` (#19702) @bernardobelchior
|
|
143
|
+
- [code-infra] Make `x-charts-premium` releasable (#18959) @JCQuintas
|
|
144
|
+
- [docs-infra] Ensure `create-playground` script only runs if target file is absent (#19603) @michelengelen
|
|
145
|
+
- [docs-infra] Add @prakhargupta1 as a codeowner of the docs (#19679) @alexfauquette
|
|
146
|
+
|
|
147
|
+
### Miscellaneous
|
|
148
|
+
|
|
149
|
+
- [test] Reduce time for wheel zoom test (#19571) @alexfauquette
|
|
150
|
+
- Change `matchPackageNames` to `matchDepNames` for date-fns-v2 @Janpot
|
|
151
|
+
- Remove groupName for date-fns-v2 in renovate.json @Janpot
|
|
152
|
+
|
|
8
153
|
## 8.11.3
|
|
9
154
|
|
|
10
155
|
_Sep 16, 2025_
|
|
@@ -27,11 +172,11 @@ The following are all team members who have contributed to this release:
|
|
|
27
172
|
- [DataGrid] Fix numeric font size not being applied (#19552) @cherniavskii
|
|
28
173
|
- [DataGrid] Improve `operator` types to display literal values (#19529) @siriwatknp
|
|
29
174
|
|
|
30
|
-
#### `@mui/x-data-grid-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link
|
|
175
|
+
#### `@mui/x-data-grid-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
176
|
|
|
32
177
|
Same changes as in `@mui/x-data-grid@8.11.3`.
|
|
33
178
|
|
|
34
|
-
#### `@mui/x-data-grid-premium@8.11.3` [](https://mui.com/r/x-premium-svg-link
|
|
179
|
+
#### `@mui/x-data-grid-premium@8.11.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
35
180
|
|
|
36
181
|
Same changes as in `@mui/x-data-grid-pro@8.11.3`.
|
|
37
182
|
|
|
@@ -41,7 +186,7 @@ Same changes as in `@mui/x-data-grid-pro@8.11.3`.
|
|
|
41
186
|
|
|
42
187
|
- [pickers] Refactor `slots` and `slotProps` propagation strategy (#18867) @LukasTy
|
|
43
188
|
|
|
44
|
-
#### `@mui/x-date-pickers-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link
|
|
189
|
+
#### `@mui/x-date-pickers-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
45
190
|
|
|
46
191
|
Same changes as in `@mui/x-date-pickers@8.11.3`.
|
|
47
192
|
|
|
@@ -55,7 +200,7 @@ Same changes as in `@mui/x-date-pickers@8.11.3`.
|
|
|
55
200
|
- [charts] Rename `isBandScale` to `isDiscreteScale` (#19514) @bernardobelchior
|
|
56
201
|
- [charts] Fix legend position affecting toolbar's position (#19257) @sai6855
|
|
57
202
|
|
|
58
|
-
#### `@mui/x-charts-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link
|
|
203
|
+
#### `@mui/x-charts-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
59
204
|
|
|
60
205
|
Same changes as in `@mui/x-charts@8.11.3`, plus:
|
|
61
206
|
|
|
@@ -69,7 +214,7 @@ Same changes as in `@mui/x-charts@8.11.3`, plus:
|
|
|
69
214
|
- [tree view] Support flat DOM structure (#19350) @flaviendelangle
|
|
70
215
|
- [tree view] Update cursor styles for disabled TreeItem (#19548) @sai6855
|
|
71
216
|
|
|
72
|
-
#### `@mui/x-tree-view-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link
|
|
217
|
+
#### `@mui/x-tree-view-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
73
218
|
|
|
74
219
|
Same changes as in `@mui/x-tree-view@8.11.3`.
|
|
75
220
|
|
|
@@ -83,7 +228,7 @@ Internal changes.
|
|
|
83
228
|
|
|
84
229
|
- [docs] Add styling row group recipe (#19349) @siriwatknp
|
|
85
230
|
- [docs] Group demos data into the dataset folder (#19549) @alexfauquette
|
|
86
|
-
- [docs] Add `shiny` bar chart example at the top
|
|
231
|
+
- [docs] Add `shiny` bar chart example at the top (#19416) @JCQuintas
|
|
87
232
|
|
|
88
233
|
### Core
|
|
89
234
|
|
|
@@ -67,6 +67,7 @@ export interface BaseDateTimePickerProps extends Omit<BasePickerInputProps<Picke
|
|
|
67
67
|
type UseDateTimePickerDefaultizedProps<Props extends BaseDateTimePickerProps> = LocalizedComponent<Omit<DefaultizedProps<Props, 'openTo' | 'orientation' | 'ampm' | ValidateDateTimePropsToDefault>, 'views'>> & {
|
|
68
68
|
shouldRenderTimeInASingleColumn: boolean;
|
|
69
69
|
views: readonly DateOrTimeViewWithMeridiem[];
|
|
70
|
+
viewsForFormatting: readonly DateOrTimeViewWithMeridiem[];
|
|
70
71
|
};
|
|
71
72
|
export declare function useDateTimePickerDefaultizedProps<Props extends BaseDateTimePickerProps>(props: Props, name: string): UseDateTimePickerDefaultizedProps<Props>;
|
|
72
73
|
export {};
|
package/DateTimePicker/shared.js
CHANGED
|
@@ -51,12 +51,16 @@ function useDateTimePickerDefaultizedProps(props, name) {
|
|
|
51
51
|
timeSteps: themeProps.timeSteps,
|
|
52
52
|
views: defaultViews
|
|
53
53
|
});
|
|
54
|
+
|
|
55
|
+
// Keep the original views for format calculation (before filtering)
|
|
56
|
+
const viewsForFormatting = ampm ? [...defaultViews, 'meridiem'] : defaultViews;
|
|
54
57
|
return (0, _extends2.default)({}, themeProps, validationProps, {
|
|
55
58
|
timeSteps,
|
|
56
59
|
openTo,
|
|
57
60
|
shouldRenderTimeInASingleColumn,
|
|
58
61
|
thresholdToRenderTimeInASingleColumn,
|
|
59
62
|
views,
|
|
63
|
+
viewsForFormatting,
|
|
60
64
|
ampm,
|
|
61
65
|
localeText,
|
|
62
66
|
orientation: themeProps.orientation ?? 'portrait',
|
|
@@ -119,7 +119,9 @@ const DesktopDateTimePicker = exports.DesktopDateTimePicker = /*#__PURE__*/React
|
|
|
119
119
|
// Props with the default values specific to the desktop variant
|
|
120
120
|
const props = (0, _extends2.default)({}, defaultizedProps, {
|
|
121
121
|
viewRenderers,
|
|
122
|
-
format: (0, _dateTimeUtils.resolveDateTimeFormat)(adapter,
|
|
122
|
+
format: (0, _dateTimeUtils.resolveDateTimeFormat)(adapter, (0, _extends2.default)({}, defaultizedProps, {
|
|
123
|
+
views: defaultizedProps.viewsForFormatting
|
|
124
|
+
})),
|
|
123
125
|
views,
|
|
124
126
|
yearsPerRow: defaultizedProps.yearsPerRow ?? 4,
|
|
125
127
|
ampmInClock,
|
|
@@ -65,7 +65,9 @@ const MobileDateTimePicker = exports.MobileDateTimePicker = /*#__PURE__*/React.f
|
|
|
65
65
|
// Props with the default values specific to the mobile variant
|
|
66
66
|
const props = (0, _extends2.default)({}, defaultizedProps, {
|
|
67
67
|
viewRenderers,
|
|
68
|
-
format: (0, _dateTimeUtils.resolveDateTimeFormat)(adapter,
|
|
68
|
+
format: (0, _dateTimeUtils.resolveDateTimeFormat)(adapter, (0, _extends2.default)({}, defaultizedProps, {
|
|
69
|
+
views: defaultizedProps.viewsForFormatting
|
|
70
|
+
})),
|
|
69
71
|
views,
|
|
70
72
|
ampmInClock,
|
|
71
73
|
slots: (0, _extends2.default)({
|
|
@@ -67,6 +67,7 @@ export interface BaseDateTimePickerProps extends Omit<BasePickerInputProps<Picke
|
|
|
67
67
|
type UseDateTimePickerDefaultizedProps<Props extends BaseDateTimePickerProps> = LocalizedComponent<Omit<DefaultizedProps<Props, 'openTo' | 'orientation' | 'ampm' | ValidateDateTimePropsToDefault>, 'views'>> & {
|
|
68
68
|
shouldRenderTimeInASingleColumn: boolean;
|
|
69
69
|
views: readonly DateOrTimeViewWithMeridiem[];
|
|
70
|
+
viewsForFormatting: readonly DateOrTimeViewWithMeridiem[];
|
|
70
71
|
};
|
|
71
72
|
export declare function useDateTimePickerDefaultizedProps<Props extends BaseDateTimePickerProps>(props: Props, name: string): UseDateTimePickerDefaultizedProps<Props>;
|
|
72
73
|
export {};
|
|
@@ -43,12 +43,16 @@ export function useDateTimePickerDefaultizedProps(props, name) {
|
|
|
43
43
|
timeSteps: themeProps.timeSteps,
|
|
44
44
|
views: defaultViews
|
|
45
45
|
});
|
|
46
|
+
|
|
47
|
+
// Keep the original views for format calculation (before filtering)
|
|
48
|
+
const viewsForFormatting = ampm ? [...defaultViews, 'meridiem'] : defaultViews;
|
|
46
49
|
return _extends({}, themeProps, validationProps, {
|
|
47
50
|
timeSteps,
|
|
48
51
|
openTo,
|
|
49
52
|
shouldRenderTimeInASingleColumn,
|
|
50
53
|
thresholdToRenderTimeInASingleColumn,
|
|
51
54
|
views,
|
|
55
|
+
viewsForFormatting,
|
|
52
56
|
ampm,
|
|
53
57
|
localeText,
|
|
54
58
|
orientation: themeProps.orientation ?? 'portrait',
|
|
@@ -112,7 +112,9 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
|
|
|
112
112
|
// Props with the default values specific to the desktop variant
|
|
113
113
|
const props = _extends({}, defaultizedProps, {
|
|
114
114
|
viewRenderers,
|
|
115
|
-
format: resolveDateTimeFormat(adapter, defaultizedProps
|
|
115
|
+
format: resolveDateTimeFormat(adapter, _extends({}, defaultizedProps, {
|
|
116
|
+
views: defaultizedProps.viewsForFormatting
|
|
117
|
+
})),
|
|
116
118
|
views,
|
|
117
119
|
yearsPerRow: defaultizedProps.yearsPerRow ?? 4,
|
|
118
120
|
ampmInClock,
|
|
@@ -58,7 +58,9 @@ const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTi
|
|
|
58
58
|
// Props with the default values specific to the mobile variant
|
|
59
59
|
const props = _extends({}, defaultizedProps, {
|
|
60
60
|
viewRenderers,
|
|
61
|
-
format: resolveDateTimeFormat(adapter, defaultizedProps
|
|
61
|
+
format: resolveDateTimeFormat(adapter, _extends({}, defaultizedProps, {
|
|
62
|
+
views: defaultizedProps.viewsForFormatting
|
|
63
|
+
})),
|
|
62
64
|
views,
|
|
63
65
|
ampmInClock,
|
|
64
66
|
slots: _extends({
|
package/esm/index.js
CHANGED
|
@@ -265,6 +265,9 @@ export function PickerFieldUI(props) {
|
|
|
265
265
|
}
|
|
266
266
|
const resolvedTextFieldInputProps = materialMajor >= 6 && textFieldProps?.slotProps?.input ? resolveComponentProps(mergeSlotProps(textFieldInputProps, additionalTextFieldInputProps), ownerState) : _extends({}, textFieldInputProps, additionalTextFieldInputProps);
|
|
267
267
|
|
|
268
|
+
// We need to resolve the `inputProps` since we are messing with those props in this component.
|
|
269
|
+
textFieldProps.inputProps = materialMajor >= 6 && textFieldProps?.slotProps?.htmlInput ? resolveComponentProps(textFieldProps.slotProps.htmlInput, ownerState) : textFieldProps.inputProps;
|
|
270
|
+
|
|
268
271
|
// Remove the `input` slotProps to avoid them overriding the manually resolved `InputProps`.
|
|
269
272
|
// Relevant on `materialMajor >= 6` since `slotProps` would take precedence.
|
|
270
273
|
delete textFieldProps?.slotProps?.input;
|
|
@@ -305,8 +305,9 @@ export const useFieldState = parameters => {
|
|
|
305
305
|
|
|
306
306
|
// If `prop.value` changes, we update the state to reflect the new value
|
|
307
307
|
if (value !== state.lastExternalValue) {
|
|
308
|
+
const isActiveDateInvalid = sectionToUpdateOnNextInvalidDateRef.current != null && !adapter.isValid(fieldValueManager.getDateFromSection(value, state.sections[sectionToUpdateOnNextInvalidDateRef.current.sectionIndex]));
|
|
308
309
|
let sections;
|
|
309
|
-
if (
|
|
310
|
+
if (isActiveDateInvalid) {
|
|
310
311
|
sections = setSectionValue(sectionToUpdateOnNextInvalidDateRef.current.sectionIndex, sectionToUpdateOnNextInvalidDateRef.current.value);
|
|
311
312
|
} else {
|
|
312
313
|
sections = getSectionsFromValue(value);
|
|
@@ -319,7 +320,7 @@ export const useFieldState = parameters => {
|
|
|
319
320
|
isRtl,
|
|
320
321
|
locale: adapter.locale
|
|
321
322
|
},
|
|
322
|
-
referenceValue: fieldValueManager.updateReferenceValue(adapter, value, prevState.referenceValue),
|
|
323
|
+
referenceValue: isActiveDateInvalid ? prevState.referenceValue : fieldValueManager.updateReferenceValue(adapter, value, prevState.referenceValue),
|
|
323
324
|
tempValueStrAndroid: null
|
|
324
325
|
}));
|
|
325
326
|
}
|
package/index.js
CHANGED
|
@@ -278,6 +278,9 @@ function PickerFieldUI(props) {
|
|
|
278
278
|
}
|
|
279
279
|
const resolvedTextFieldInputProps = _version.major >= 6 && textFieldProps?.slotProps?.input ? (0, _resolveComponentProps.default)(mergeSlotProps(textFieldInputProps, additionalTextFieldInputProps), ownerState) : (0, _extends2.default)({}, textFieldInputProps, additionalTextFieldInputProps);
|
|
280
280
|
|
|
281
|
+
// We need to resolve the `inputProps` since we are messing with those props in this component.
|
|
282
|
+
textFieldProps.inputProps = _version.major >= 6 && textFieldProps?.slotProps?.htmlInput ? (0, _resolveComponentProps.default)(textFieldProps.slotProps.htmlInput, ownerState) : textFieldProps.inputProps;
|
|
283
|
+
|
|
281
284
|
// Remove the `input` slotProps to avoid them overriding the manually resolved `InputProps`.
|
|
282
285
|
// Relevant on `materialMajor >= 6` since `slotProps` would take precedence.
|
|
283
286
|
delete textFieldProps?.slotProps?.input;
|
|
@@ -312,8 +312,9 @@ const useFieldState = parameters => {
|
|
|
312
312
|
|
|
313
313
|
// If `prop.value` changes, we update the state to reflect the new value
|
|
314
314
|
if (value !== state.lastExternalValue) {
|
|
315
|
+
const isActiveDateInvalid = sectionToUpdateOnNextInvalidDateRef.current != null && !adapter.isValid(fieldValueManager.getDateFromSection(value, state.sections[sectionToUpdateOnNextInvalidDateRef.current.sectionIndex]));
|
|
315
316
|
let sections;
|
|
316
|
-
if (
|
|
317
|
+
if (isActiveDateInvalid) {
|
|
317
318
|
sections = setSectionValue(sectionToUpdateOnNextInvalidDateRef.current.sectionIndex, sectionToUpdateOnNextInvalidDateRef.current.value);
|
|
318
319
|
} else {
|
|
319
320
|
sections = getSectionsFromValue(value);
|
|
@@ -326,7 +327,7 @@ const useFieldState = parameters => {
|
|
|
326
327
|
isRtl,
|
|
327
328
|
locale: adapter.locale
|
|
328
329
|
},
|
|
329
|
-
referenceValue: fieldValueManager.updateReferenceValue(adapter, value, prevState.referenceValue),
|
|
330
|
+
referenceValue: isActiveDateInvalid ? prevState.referenceValue : fieldValueManager.updateReferenceValue(adapter, value, prevState.referenceValue),
|
|
330
331
|
tempValueStrAndroid: null
|
|
331
332
|
}));
|
|
332
333
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.12.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The community edition of the MUI X Date and Time Picker components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
41
|
"react-transition-group": "^4.4.5",
|
|
42
|
-
"@mui/x-internals": "8.
|
|
42
|
+
"@mui/x-internals": "8.12.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@emotion/react": "^11.9.0",
|