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] Make changeImportance and shortcut mandatory in PickersShortcuts #10941

Merged
merged 11 commits into from
Nov 29, 2023

Conversation

flaviendelangle
Copy link
Member

Closes #10940

@flaviendelangle flaviendelangle self-assigned this Nov 8, 2023
@flaviendelangle flaviendelangle added breaking change component: pickers This is the name of the generic UI component, not the React module! v7.x labels Nov 8, 2023
@mui-bot
Copy link

mui-bot commented Nov 8, 2023

@flaviendelangle flaviendelangle changed the title [pickers] V7: Make and mandatory [pickers] V7: Make changeImportance and shortcut mandatory in PickersShortcut Nov 8, 2023
@flaviendelangle flaviendelangle changed the title [pickers] V7: Make changeImportance and shortcut mandatory in PickersShortcut [pickers] V7: Make changeImportance and shortcut mandatory in PickersShortcuts Nov 8, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 14, 2023
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 Nov 14, 2023
@flaviendelangle
Copy link
Member Author

@LukasTy @alexfauquette that one may have disappeared in your notifications
It's the last small breaking change remaining for the pickers

Comment on lines +78 to +79
- The [`changeImportance`](/x/react-date-pickers/shortcuts/#behavior-when-selecting-a-shortcut) of the shortcut.
- The `item` containing the entire shortcut object.
Copy link
Member

Choose a reason for hiding this comment

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

I assume not providing the changeImportance will lead to broken shortcuts.
But for the item I'm not sure about what's the impact.

If I correctly understand, the usage of item is to provide some context to the onChange. What do you think about saying the last parameter is the shortcut context? Such that devs know they can pass whatever they think valuable for the onChange

Copy link
Member Author

Choose a reason for hiding this comment

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

If I correctly understand, the usage of item is to provide some context to the onChange

Yes, it's just passed directly to context.shortcut.

What do you think about saying the last parameter is the shortcut context? Such that devs know they can pass whatever they think valuable for the onChange

I guess it's unlikely that we will ever use this value for something else than just forwarding it to the context, so people should be able to pass whatever they want indeed.

Would you agree that it's not the role of the migration guide though? More the role of the shortcut doc if we want to highlight this ability at some point.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it's just that it's the only place where this feature is explained for now

@LukasTy LukasTy changed the title [pickers] V7: Make changeImportance and shortcut mandatory in PickersShortcuts [pickers] Make changeImportance and shortcut mandatory in PickersShortcuts Nov 28, 2023
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.

LGTM. 👌

flaviendelangle and others added 2 commits November 29, 2023 08:50
Co-authored-by: Lukas <llukas.tyla@gmail.com>
Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com>
Co-authored-by: Lukas <llukas.tyla@gmail.com>
Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com>
@flaviendelangle flaviendelangle merged commit 46c79b2 into mui:next Nov 29, 2023
17 checks passed
@flaviendelangle flaviendelangle deleted the shortcut-bc branch November 29, 2023 09:31
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! v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pickers] V7: Make changeImportance and shortcut mandatory
4 participants