Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix: prevent icon from shrinking when label text overflows
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikThePendric committed May 19, 2020
1 parent d398881 commit ccd86bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MenuItem/MenuItemContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ const MenuItemContent = forwardRef(
target={target}
{...linkElementProps}
>
{icon}
<div className="label">{label}</div>
{icon && <span className="icon">{icon}</span>}
<span className="label">{label}</span>

{showChevron && (
<ChevronRight className={subChevron.className} />
Expand Down
3 changes: 3 additions & 0 deletions src/__demo__/Menu.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import { storiesOf } from '@storybook/react'

import { Menu, MenuItem, Divider, Switch } from '../index.js'
import { ArrowUp } from '../icons/Arrow.js'

const Wrapper = fn => <div style={{}}>{fn()}</div>

Expand Down Expand Up @@ -53,13 +54,15 @@ storiesOf('Menu', module)
<MenuItem
label="This is a long menu item name, that should span onto multiple lines"
value="two"
icon={<ArrowUp />}
onClick={val => {
alert(`this is ${val}`)
}}
/>
<MenuItem
label="Three"
value="three"
icon={<ArrowUp />}
onClick={val => {
alert(`this is ${val}`)
}}
Expand Down

0 comments on commit ccd86bc

Please sign in to comment.