-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Conversation
Netlify deploy previewhttps://deploy-preview-38996--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
@@ -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 && |
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.
This change reduces the CSS specificity, how about:
[`&.${buttonClasses.disabled}`]: theme.variants[`${ownerState.variant!}Disabled`]?.[ownerState.color!]
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.
made the change.
closes #38960
reason for bug: #38960 (comment)
before: https://codesandbox.io/s/joy-disabled-non-button-forked-rpr9dk?file=/Demo.js
after: https://codesandbox.io/s/reverent-franklin-gvlk7j