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

MenuItem right icons are not styleable if desktop=false #2566

Closed
birnam opened this issue Dec 17, 2015 · 5 comments
Closed

MenuItem right icons are not styleable if desktop=false #2566

birnam opened this issue Dec 17, 2015 · 5 comments
Labels
bug 🐛 Something doesn't work

Comments

@birnam
Copy link
Contributor

birnam commented Dec 17, 2015

https://github.com/callemall/material-ui/blob/master/src/menus/menu-item.jsx#L168-L172

if (rightIcon) {
  const mergedRightIconStyles = desktop ?
    this.mergeStyles(styles.rightIconDesktop, rightIcon.props.style) : null;
  rightIconElement = React.cloneElement(rightIcon, {style: mergedRightIconStyles});
}

In MenuItem when merging styles.rightIconDesktop with rightIcon.props.style, the merge only happens if desktop == true, otherwise it sets it to null. If desktop == false it should at least preserve the style property the developer provided for the rightIcon.

if (rightIcon) {
  const mergedRightIconStyles = desktop ?
    this.mergeStyles(styles.rightIconDesktop, rightIcon.props.style) : rightIcon.props.style;
  rightIconElement = React.cloneElement(rightIcon, {style: mergedRightIconStyles});
}
@oliviertassinari
Copy link
Member

@birnam Thanks for finding this. Do you want to submit a PR to fix it?
I think that it would be good to add an example with desktop={false} and a right icon.
Today, we only have an example with {desktop=true}.

@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Dec 17, 2015
@birnam
Copy link
Contributor Author

birnam commented Dec 17, 2015

Sure @oliviertassinari I'll get that to you asap

@birnam
Copy link
Contributor Author

birnam commented Dec 18, 2015

PR @oliviertassinari : #2589

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

No branches or pull requests

3 participants
@birnam @oliviertassinari and others