Skip to content

[PickersDay] Remove PickersDay and promote PickerDay2 as a replacement#21739

Open
michelengelen wants to merge 17 commits intomui:masterfrom
michelengelen:bugfix/21615-misaligned-days-in-picker
Open

[PickersDay] Remove PickersDay and promote PickerDay2 as a replacement#21739
michelengelen wants to merge 17 commits intomui:masterfrom
michelengelen:bugfix/21615-misaligned-days-in-picker

Conversation

@michelengelen
Copy link
Member

@michelengelen michelengelen commented Mar 13, 2026

This prevents misalignment when the theme used by the user has a display definition in their typography.caption theme object.

Fixes #21615

@michelengelen michelengelen self-assigned this Mar 13, 2026
@michelengelen michelengelen added type: bug It doesn't behave as expected. scope: pickers Changes related to the date/time pickers. needs cherry-pick The PR should be cherry-picked to master after merge. v8.x labels Mar 13, 2026
@mui-bot
Copy link

mui-bot commented Mar 13, 2026

Deploy preview: https://deploy-preview-21739--material-ui-x.netlify.app/

Updated pages:

Bundle size report

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 ▼-3.81KB(-1.66%) ▼-642B(-1.02%)
@mui/x-date-pickers-pro ▼-9.19KB(-2.87%) ▼-1.59KB(-1.87%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 4f58898

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

A couple of additional notes:

  • nitpick: this doesn't look like a pro (DateRangePicker) package change in any way

  • Have you considered the change for PickersDay2 as well?

    • Side note: WDYT, @noraleonte, is that component ready to replace the OG one?
      It's a breaking change, because of styling requirements. So, now, or wait another ~year 🙈
  • Now that I have seen this, I can not unsee it. 🙈
    How come the day number is not vertically aligned within the button? 😂

    Screen.Recording.2026-03-19.at.16.40.40.mov

    @noraleonte, have you noticed this? Do you have a better fix for this than line-height: 1? 🤔


const styleArg = ({ theme }: { theme: Theme }) => ({
...theme.typography.caption,
display: 'block',
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't flex work here?
As it stands now, this is a tiny BC for anyone who used a week picker example from our docs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would work as well ... I just took the value that was initially set for this.

Copy link
Member

Choose a reason for hiding this comment

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

agree, it should not impact the docs demo.

@michelengelen
Copy link
Member Author

  • nitpick: this doesn't look like a pro (DateRangePicker) package change in any way

Yes, you are right ... I just took this since it was reported from that component in the bug-issue. Will change that.

  • Have you considered the change for PickersDay2 as well?

No, thanks for pointing me to that though.

  • Side note: WDYT, @noraleonte, is that component ready to replace the OG one?
    It's a breaking change, because of styling requirements. So, now, or wait another ~year 🙈

If possible in any way I would like to include any breaking changes now, ideally with this release. So if there is a decision to be made I would go for it now.

  • Now that I have seen this, I can not unsee it. 🙈
    How come the day number is not vertically aligned within the button? 😂

🫣

@noraleonte, have you noticed this? Do you have a better fix for this than line-height: 1? 🤔

@michelengelen michelengelen changed the title [DateRangePicker] Set display: block for PickersDay component style [PickersDay] Set display: block for PickersDay component style Mar 19, 2026
@michelengelen
Copy link
Member Author

michelengelen commented Mar 19, 2026

@noraleonte, have you noticed this? Do you have a better fix for this than line-height: 1? 🤔

@LukasTy I would love to use text-box, but it seems we are a bit early for this, since it is not yet widely adopted

@noraleonte
Copy link
Contributor

WDYT, @noraleonte, is that component ready to replace the OG one?
It's a breaking change, because of styling requirements. So, now, or wait another ~year 🙈

I think it might be, but seems a bit short notice to include it in this release 🙈 I'm not worried about the component not being ready, it's more that it's a breaking change, comes with a migration guide + we need to check all the demos are still working properly (customization ones especially) 🙈

@noraleonte, have you noticed this? Do you have a better fix for this than line-height: 1? 🤔

I haven't noticed it but now it's bugging me. Present in PickersDay2 as well btw 🙈 line-height seems to do the job here. Agree with Michel that we should wait a bit for text-box

@LukasTy
Copy link
Member

LukasTy commented Mar 20, 2026

So, to conclude, I see two paths:

Lazy

  • Remove change in WeekPicker
  • Set display: flex on PickersDay and PickersDay2
  • Add a migration page entry notifying about the change and urging upgraders to double-check if all is good in their custom implementations (should be fine in at least 99% of cases)

Proper bad-ass 😆

  • Remove change in WeekPicker
  • Remove PickersDay
  • Remove https://mui.com/x/react-date-pickers/custom-components/#day demo
  • Set display: flex on PickersDay2
  • Rename PickersDay2 to PickersDay and DateRangePickerDay2 to DateRangePickerDay
  • Add codemod removing the slots={{ day: PickerDay2 }} and slots={{ day: DateRangePickerDay2 }} usages
  • Add migration guide entry about this component change as well as the display: flex
  • Hope Argos is happy and do some manual testing 👌

In both cases, I'd urge setting line-height: 1 to fix vertical alignment.

Does that sound about right, @noraleonte?

I leave the decision to @michelengelen.

@noraleonte
Copy link
Contributor

Yes, that's a pretty accurate summary 👌

@michelengelen michelengelen changed the title [PickersDay] Set display: block for PickersDay component style [PickersDay] Remove PickersDay and promote PickerDay2 as a replacement Mar 23, 2026
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.

[question] MuiDateRangePickerDay-day applying display inline which causes the date columns to be misaligned

5 participants