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][IconButton] Set default loading to null #45057

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

siriwatknp
Copy link
Member

closes #45048

@siriwatknp siriwatknp added component: icon button This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Jan 20, 2025
Comment on lines +219 to +226
{typeof loading === 'boolean' && (
// use plain HTML span to minimize the runtime overhead
<span className={classes.loadingWrapper} style={{ display: 'contents' }}>
<IconButtonLoadingIndicator className={classes.loadingIndicator} ownerState={ownerState}>
{loading && loadingIndicator}
</IconButtonLoadingIndicator>
</span>
)}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the same as Button

@mui-bot
Copy link

mui-bot commented Jan 20, 2025

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against bab233c

Copy link
Member

@aarongarciah aarongarciah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding a test is worth it.

@siriwatknp
Copy link
Member Author

I think adding a test is worth it.

Added a test to check that no element is rendered when loading is null.

I don't think it's worth to test the loading wrapper as it's an implementation detail. The progressbar test is already enough.

@siriwatknp siriwatknp merged commit 33ce030 into mui:master Jan 20, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: icon button This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update IconButton's loading prop type to match Button's
3 participants