Skip to content

[utils] Fix resolveProps receiving empty string className#48289

Merged
mj12albert merged 2 commits into
mui:masterfrom
SAY-5:fix/resolveprops-empty-classname-default-v2
Apr 15, 2026
Merged

[utils] Fix resolveProps receiving empty string className#48289
mj12albert merged 2 commits into
mui:masterfrom
SAY-5:fix/resolveprops-empty-classname-default-v2

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented Apr 15, 2026

Prevents the default className from being dropped when a component receives className=""

Fixes #48287

@mui-bot
Copy link
Copy Markdown

mui-bot commented Apr 15, 2026

Netlify deploy preview

https://deploy-preview-48289--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+9B(0.00%) 🔺+2B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 🔺+9B(+0.01%) 🔺+2B(+0.01%)
@mui/utils 🔺+9B(+0.06%) 🔺+2B(+0.04%)

Details of bundle changes

Generated by 🚫 dangerJS against 535000b

@mj12albert mj12albert force-pushed the fix/resolveprops-empty-classname-default-v2 branch from 1ee48b0 to 9516781 Compare April 15, 2026 09:06
@mj12albert mj12albert added the type: bug It doesn't behave as expected. label Apr 15, 2026
@mj12albert mj12albert changed the title fix(utils): keep default className when prop className is an empty string [utils] Fix resolveProps receiving empty string className Apr 15, 2026
@mj12albert mj12albert force-pushed the fix/resolveprops-empty-classname-default-v2 branch from 9516781 to 535000b Compare April 15, 2026 09:13
@mj12albert
Copy link
Copy Markdown
Member

Thanks for the PR, I simplified the fix and added tests

@mj12albert mj12albert enabled auto-merge (squash) April 15, 2026 09:21
@code-infra-dashboard
Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+9B(0.00%) 🔺+2B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 🔺+9B(+0.01%) 🔺+2B(+0.01%)
@mui/utils 🔺+9B(+0.06%) 🔺+2B(+0.04%)

Details of bundle changes

Deploy preview

https://deploy-preview-48289--material-ui.netlify.app/


Check out the code infra dashboard for more information about this PR.

@mj12albert mj12albert merged commit c537f78 into mui:master Apr 15, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[utils] Empty string className causes resolveProps to drop default className

3 participants