Skip to content

Commit

Permalink
Merge pull request #2589 from birnam/issue-2566-menu-righticon-style
Browse files Browse the repository at this point in the history
Bug fix, issue 2566 -- MenuItem right icon loses styles
  • Loading branch information
oliviertassinari committed Dec 18, 2015
2 parents efcddb2 + d3f9b27 commit 53d7a3e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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

0 comments on commit 53d7a3e

Please sign in to comment.