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
[LoadingButton] Fix padding of loading icon in small button #31113
Conversation
Thanks for tackling this PunitSoniME! Is this change ready to merge? Definitely would appreciate the bug fix being released! |
@sjdemartini Yes it is ready to merge |
Can you please merge this PR ? |
@PunitSoniME I'm not a maintainer unfortunately, just the person who filed the original bug report. @hbjORbj would you be able to merge this in? Thanks! |
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.
It should be this, otherwise <LoadingButton size="small" variant="text">
will cause a regression.
{
...(ownerState.loadingPosition === 'start' &&
(ownerState.variant === 'outlined' || ownerState.variant === 'contained') && {
left: ownerState.size === 'small' ? 10 : 14,
}),
...(ownerState.loadingPosition === 'end' &&
(ownerState.variant === 'outlined' || ownerState.variant === 'contained') && {
right: ownerState.size === 'small' ? 10 : 14,
}),
}
Also, can you add size small
to the loading demo so that we have the regression test.
@sjdemartini Hey, sure, we can merge after tests are written. @PunitSoniME Would you add unit tests for the change you made? You can add them to this file: https://github.com/mui/material-ui/blob/master/packages/mui-lab/src/LoadingButton/LoadingButton.test.js |
Would a visual test be more effective? |
adding a small button to the loading demo should be enough. |
@siriwatknp @oliviertassinari @hbjORbj I hope this would be enough to merge. |
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.
👍 Thanks for the fix! I updated the demo to have initial loading so that we can track the visual regression.
Closes #31109