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

[material-ui] Add merging function to mergeSlotProps utility #45543

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

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Mar 11, 2025

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 the slotProps.* 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.*


@siriwatknp siriwatknp added the package: material-ui Specific to @mui/material label Mar 11, 2025
@mui-bot
Copy link

mui-bot commented Mar 11, 2025

Netlify deploy preview

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 98b9dd9

@zannager zannager requested a review from DiegoAndai March 12, 2025 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[material-ui] mergeSlotProps doesn't handle functions
2 participants