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

[joy-ui][Button] fix disabled button styling when component prop is provided #38996

Merged
merged 15 commits into from
Sep 26, 2023

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented Sep 15, 2023

@mui-bot
Copy link

mui-bot commented Sep 15, 2023

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against b347b14

@sai6855 sai6855 marked this pull request as draft September 15, 2023 13:18
@sai6855 sai6855 added bug 🐛 Something doesn't work component: button This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy labels Sep 15, 2023
@sai6855 sai6855 marked this pull request as ready for review September 18, 2023 10:25
@@ -157,7 +157,8 @@ export const getButtonStyles = ({
},
'&:active, &[aria-pressed="true"]':
theme.variants[`${ownerState.variant!}Active`]?.[ownerState.color!],
'&:disabled': theme.variants[`${ownerState.variant!}Disabled`]?.[ownerState.color!],
...(ownerState.disabled &&
Copy link
Member

Choose a reason for hiding this comment

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

This change reduces the CSS specificity, how about:

[`&.${buttonClasses.disabled}`]: theme.variants[`${ownerState.variant!}Disabled`]?.[ownerState.color!]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made the change.

@sai6855 sai6855 mentioned this pull request Sep 25, 2023
@michaldudak michaldudak merged commit 86c4df5 into mui:master Sep 26, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: button This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[joy-ui][Button] Disabled style is not applied when component prop is used
4 participants