Skip to content

Commit

Permalink
fix: add ellipsis for menu items with long words
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Nov 24, 2017
1 parent 335deb9 commit 3421be2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SideMenu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class MenuItem extends React.Component<MenuItemProps> {
<OperationMenuItemContent item={item as OperationModel} />
) : (
<MenuItemLabel depth={item.depth} active={item.active}>
<MenuItemTitle>{item.name}</MenuItemTitle>
<MenuItemTitle title={item.name}>{item.name}</MenuItemTitle>
{(item.depth > 0 &&
item.items.length > 0 && (
<ShelfIcon float={'right'} direction={item.active ? 'down' : 'right'} />
Expand Down
2 changes: 2 additions & 0 deletions src/components/SideMenu/styled.elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,6 @@ export const MenuItemTitle = withProps<{ width?: string }>(styled.span).attrs({
display: inline-block;
vertical-align: middle;
width: ${props => (props.width ? props.width : 'auto')};
overflow: hidden;
text-overflow: ellipsis;
`;

0 comments on commit 3421be2

Please sign in to comment.