-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
IconMenu with FlatButton unknown props warning #4857
Comments
Same for IconMenu + RaisedButton with Material-UI 0.15.3:
The warning trace is:
|
I'm still seeing the warnings in version 0.15.3 for disabledBackgroundColor and disabledLabelColor properties of the RaisedButton component. |
react-unknown-props for disabledBackgroundColor and disabledLabelColor properties of the RaisedButton component. v15.3.0 |
The root cause of this issue appears to be the merging of the https://github.com/callemall/material-ui/blob/master/src/IconMenu/IconMenu.js#L272 const iconButton = React.cloneElement(iconButtonElement, {
onKeyboardFocus: onKeyboardFocus,
iconStyle: Object.assign({}, iconStyle, iconButtonElement.props.iconStyle), // <--
onTouchTap: (event) => {
this.open(Events.isKeyboard(event) ? 'keyboard' : 'iconTap', event);
if (iconButtonElement.props.onTouchTap) {
iconButtonElement.props.onTouchTap(event);
}
},
ref: 'iconButton',
}); The A proposed fix would be to only try to merge the styles if if (iconButtonElement.props.iconStyle) {
iconButton.props.iconStyle = Object.assign({}, iconStyle, iconButtonElement.props.iconStyle);
} |
Sorry to bring this up again but this still seems to happen (for me) import AccountCircleIcon from 'material-ui/svg-icons/action/account-circle';
<IconMenu
iconButtonElement={
<FlatButton
icon={<AccountCircleIcon />} //Thats the svg icon
label={'User Name'}
style={{color: 'white'}}
/>
}
/> |
Problem description
A warning when creating an IconMenu and putting a FlatButton as the iconButtonElement property
Steps to reproduce
I've tried to add the following icon menu (For a user account with its name near it)
Versions
The text was updated successfully, but these errors were encountered: