Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pickers] Update closeOnSelect and actionBar.actions default values #15944

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

LukasTy
Copy link
Member

@LukasTy LukasTy commented Dec 19, 2024

Created from #14397.

  • Changed a few approaches in the original PR to a cleaner (IMHO) solution.
  • Added migration doc section.
  • Add one additional change in lifecycle doc.

Closes #9310.

@LukasTy LukasTy added breaking change component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature v8.x labels Dec 19, 2024
@LukasTy LukasTy self-assigned this Dec 19, 2024
@mui-bot
Copy link

mui-bot commented Dec 19, 2024

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Dec 19, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Dec 20, 2024
@@ -53,6 +53,7 @@ const DesktopDateRangePicker = React.forwardRef(function DesktopDateRangePicker<

const props = {
...defaultizedProps,
closeOnSelect: defaultizedProps.closeOnSelect ?? true,
Copy link
Member Author

Choose a reason for hiding this comment

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

Explicitly providing true default in case of DesktopDateRangePicker and DatePicker.

@LukasTy LukasTy marked this pull request as ready for review December 20, 2024 12:16
Only `<DesktopDatePicker />` and `<DesktopDateRangePicker />` have `closeOnSelect` set to `true` by default.

This change goes hand in hand with the new default `actions` prop value for the `<PickersActionBar />` component.
The default value of the `actions` prop has been updated to `['cancel', 'accept']` for all Picker components with complex views, except for `<DesktopDatePicker />` and `<DesktopDateRangePicker />`.
Copy link
Member

Choose a reason for hiding this comment

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

I would remove the concept of "complex" value which is very subjectif and instead list the pickers.

This change goes hand in hand with the new default `actions` prop value for the `<PickersActionBar />` component.
The default value of the `actions` prop has been updated to `['cancel', 'accept']` for all Picker components with complex views, except for `<DesktopDatePicker />` and `<DesktopDateRangePicker />`.

If the updated values do not fit your use case, you can override them.
Copy link
Member

Choose a reason for hiding this comment

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

A link on the doc that shows how to override can be a nice addition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature v8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pickers] Improve and simplify the auto-closing strategy of pickers with a value selected in several steps
4 participants