-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[material-ui] Add merging function to mergeSlotProps
utility
#45543
Conversation
Netlify deploy preview@material-ui/core: parsed: +Infinity% , gzip: +Infinity% Bundle size reportDetails of bundle changes (Toolpad) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
May I ask you to do a final test with the example in #45210 (comment) (where this was originally discovered). Just to make sure it's fixed with this change.
…merge-slot-props-fn
closes #45503
Docs: https://deploy-preview-45543--material-ui.netlify.app/material-ui/guides/composition/#forwarding-slot-props
Issue
Currently,
mergeSlotProps
does not compose event handlers. So event handlers passed by theslotProps.*
will override the default event handlers.Fix
Iterate the default props and check if the key is an event handler (follow the same logic as in Base UI), then compose it with the one from the
slotProps.*