Skip to content
New issue

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

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

Already on GitHub? # to your account

[material-ui] Update mergeSlotProps to merge style #44959

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Jan 7, 2025

Continue from #44809, this PR merge the style instead of replacing between default slot props and external slot props.

I think it's more common from user perspective to have style merged rather than replace.

Some of the Material UI components, e.g. SwipeableDrawer, also merge the style. So this PR will benefit both internal and users.

If the user wants to remove some style from the default style, they can provide null as a value:

// default `pointerEvents` is "none"
<CustomSwipeableDrawer slotProps={{ paper: { style: { pointerEvents: null } }}>

@siriwatknp siriwatknp added the package: material-ui Specific to @mui/material label Jan 7, 2025
@siriwatknp siriwatknp requested a review from DiegoAndai January 7, 2025 06:03
@mui-bot
Copy link

mui-bot commented Jan 7, 2025

Netlify deploy preview

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 8bacb6c

@siriwatknp siriwatknp merged commit ca4e3a9 into mui:master Jan 8, 2025
22 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants