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

[IconButton] custom color causes type error #34521

Conversation

kushagra010
Copy link
Contributor

Fixes: #33054

@mui-bot
Copy link

mui-bot commented Sep 29, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-34521--material-ui.netlify.app/

Details of bundle changes

Generated by 🚫 dangerJS against 7db5ccb

@hbjORbj hbjORbj added the component: icon button This is the name of the generic UI component, not the React module! label Sep 30, 2022
@hbjORbj hbjORbj changed the title [Material] custom color causes typeError in IconButton [IconButton] custom color causes type error Sep 30, 2022
@hbjORbj hbjORbj added the bug 🐛 Something doesn't work label Sep 30, 2022
@michaldudak
Copy link
Member

michaldudak commented Oct 28, 2022

@siriwatknp would you mind reviewing it since you've been involved in the discussion in the issue?

@kushagra010 From what I can see, the PR is lacking tests.

@michaldudak michaldudak requested review from siriwatknp and removed request for mnajdova and michaldudak October 28, 2022 08:45
...(!ownerState.disableRipple && {
'&:hover': {
backgroundColor: theme.vars
? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${
theme.vars.palette.action.hoverOpacity
})`
: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
: alpha(
theme.palette?.[ownerState.color]?.main ?? theme.palette.action.active,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
theme.palette?.[ownerState.color]?.main ?? theme.palette.action.active,
theme.palette?.[ownerState.color]?.main ?? theme.palette.action.hover,

@siriwatknp siriwatknp added the PR: needs test The pull request can't be merged label Nov 7, 2022
@siriwatknp siriwatknp removed the PR: needs test The pull request can't be merged label Nov 7, 2022
Copy link
Member

@siriwatknp siriwatknp left a 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 pushed some update to simplify the logics.

@shahriarpshuvo
Copy link

When will this get merged?
This is a very annoying bug.

@siriwatknp
Copy link
Member

When will this get merged?

This is a very annoying bug.

It should be released next week, sorry for the delay.

@michaldudak michaldudak merged commit 75f5a8a into mui:master Nov 14, 2022
the-mgi pushed a commit to the-mgi/material-ui that referenced this pull request Nov 17, 2022
Co-authored-by: siriwatknp <siriwatkunaporn@gmail.com>
daniel-rabe pushed a commit to daniel-rabe/material-ui that referenced this pull request Nov 29, 2022
Co-authored-by: siriwatknp <siriwatkunaporn@gmail.com>
feliperli pushed a commit to jesrodri/material-ui that referenced this pull request Dec 6, 2022
Co-authored-by: siriwatknp <siriwatkunaporn@gmail.com>
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: icon button This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IconButton] Custom non-palette color causes TypeError
6 participants