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

Bug fix, issue 2566 -- MenuItem right icon loses styles #2589

Merged
merged 1 commit into from
Dec 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/src/app/components/pages/components/menus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Menu from 'menus/menu';
import MenuItem from 'menus/menu-item';
import Divider from 'divider';
import ComponentDoc from '../../component-doc';
import FontIcon from 'font-icon';

import ArrowDropRight from 'material-ui/svg-icons/navigation-arrow-drop-right';
import ContentCopy from 'material-ui/svg-icons/content/content-copy';
Expand Down Expand Up @@ -354,6 +355,17 @@ import Divider from 'material-ui/lib/menus/menu-divider';
<MenuItem primaryText="Page breaks" insetChildren={true} />
<MenuItem primaryText="Rules" checked={true} />
</Menu>

<Menu style={styles.menu} desktop={false}>
<MenuItem primaryText="Clear Config" />
<MenuItem primaryText="New Config" rightIcon={<PersonAdd />} />
<MenuItem primaryText="Project" rightIcon={<FontIcon className="material-icons">settings</FontIcon>}/>
<MenuItem primaryText="Workspace" rightIcon={
<FontIcon className="material-icons" style={{color: '#559'}}>settings</FontIcon>
}/>
<MenuItem primaryText="Paragraph" rightIcon={<b style={{paddingTop: 0}}></b>} />
<MenuItem primaryText="Section" rightIcon={<b style={{paddingTop: 0}}>§</b>} />
</Menu>
</CodeExample>
</ComponentDoc>
);
Expand Down
2 changes: 1 addition & 1 deletion src/menus/menu-item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const MenuItem = React.createClass({
let rightIconElement;
if (rightIcon) {
const mergedRightIconStyles = desktop ?
this.mergeStyles(styles.rightIconDesktop, rightIcon.props.style) : null;
this.mergeStyles(styles.rightIconDesktop, rightIcon.props.style) : rightIcon.props.style;
rightIconElement = React.cloneElement(rightIcon, {style: mergedRightIconStyles});
}

Expand Down