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] Add context to onAccept callback #13511

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Jun 17, 2024

Closes #11978

Do you think we should add a demo? And if so, where?

@flaviendelangle flaviendelangle added the component: pickers This is the name of the generic UI component, not the React module! label Jun 17, 2024
@flaviendelangle flaviendelangle self-assigned this Jun 17, 2024
@mui-bot
Copy link

mui-bot commented Jun 17, 2024

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

Generated by 🚫 dangerJS against 093e18e

@flaviendelangle flaviendelangle marked this pull request as ready for review June 17, 2024 09:10
@LukasTy LukasTy added the enhancement This is not a bug, nor a new feature label Jun 17, 2024
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.

Great addition! 🙏
Thank you for taking care of it. 👍

Do you have any idea of what we can showcase with it?
Currently it seems that this addition will allow preventing srange behaviors if users are relying on onAccept for certain triggers. 🤔
But if you have ideas for documentation—"I'm all ears". 👍

@flaviendelangle
Copy link
Member Author

Do you have any idea of what we can showcase with it?

I think the context param is never really documented even for onChange, which probably limits a lot the amount of people using it.

Maybe we could rename the sections in Pickers lifecycle to be onChange / onAccept / onClose.
And then in onChange and onAccept we have a sub-section "When is is `onChange called" and a sub-section "Usage" or something like that.

@LukasTy
Copy link
Member

LukasTy commented Jun 19, 2024

I think the context param is never really documented even for onChange, which probably limits a lot the amount of people using it.

I do agree, we could improve on that. 👍

Maybe we could rename the sections in Pickers lifecycle to be onChange / onAccept / onClose.
And then in onChange and onAccept we have a sub-section "When is is `onChange called" and a sub-section "Usage" or something like that.

Given your suggestion, it seems that this idea is out of the scope of this issue/PR. 🤔

@flaviendelangle
Copy link
Member Author

Given your suggestion, it seems that this idea is out of the scope of this issue/PR.

Yes, I can do it in a follow up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pickers] onAccept fired even when date is invalid, without information about error
3 participants