Skip to content

[pickers] Fix localized digit crash#22995

Merged
LukasTy merged 3 commits into
mui:masterfrom
alexfauquette:fix-20355
Jun 30, 2026
Merged

[pickers] Fix localized digit crash#22995
LukasTy merged 3 commits into
mui:masterfrom
alexfauquette:fix-20355

Conversation

@alexfauquette

Copy link
Copy Markdown
Member

Fix #20355

@alexfauquette
alexfauquette requested review from a team and michelengelen June 29, 2026 13:20
@alexfauquette alexfauquette added type: bug It doesn't behave as expected. scope: pickers Changes related to the date/time pickers. labels Jun 29, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-22995--material-ui-x.netlify.app/
QR code for https://deploy-preview-22995--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 🔺+43B(+0.02%) 🔺+51B(+0.09%)
@mui/x-date-pickers-pro 🔺+26B(+0.01%) 🔺+26B(+0.03%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-scheduler 0B(0.00%) 0B(0.00%)
@mui/x-scheduler-premium 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@LukasTy LukasTy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking the time to fix this. 🙏

Here are a couple of suggestions.
Could we apply at least the localizedDigits cleanup?

  • (Optional, reuse) useFieldSectionContentProps adds const localizedDigits = useMemo(() => getLocalizedDigits(adapter), [adapter]), but the identical value is already computed in useFieldState and exposed as stateResponse.localizedDigits -- which this hook already destructures. Reusing stateResponse.localizedDigits drops the duplicate memo + the extra getLocalizedDigits import and keeps a single source of truth. Same adapter and same memo deps, so it is functionally identical and safe.
  • (Minor, test) The reported crash was luxon ar-SD; the regression test exercises moment-hijri ar-sa. Same root cause (localized digits -> NaN), so it is a valid lock-in, but it does not directly cover the exact reported adapter/locale.

@alexfauquette
alexfauquette requested a review from LukasTy June 29, 2026 15:31
@LukasTy LukasTy added needs cherry-pick The PR should be cherry-picked to master after merge. v8.x labels Jun 30, 2026

@LukasTy LukasTy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍
Thanks. 🙏

@LukasTy
LukasTy merged commit 6fe556c into mui:master Jun 30, 2026
25 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Cherry-pick PRs will be created targeting branches: v8.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs cherry-pick The PR should be cherry-picked to master after merge. scope: pickers Changes related to the date/time pickers. type: bug It doesn't behave as expected. v8.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pickers] - ar-SD locale crashes

2 participants