From 5c7f9feecb10fab4626a2c204817650b2851ef4b Mon Sep 17 00:00:00 2001 From: picodoth Date: Wed, 11 Jul 2018 12:07:17 +0800 Subject: [PATCH] feat: prevent horizontal menu items wrapping --- components/menu/demo/horizontal.md | 3 ++- components/menu/style/index.less | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/menu/demo/horizontal.md b/components/menu/demo/horizontal.md index 2082204b24..a6934cd0c6 100755 --- a/components/menu/demo/horizontal.md +++ b/components/menu/demo/horizontal.md @@ -37,6 +37,7 @@ class App extends React.Component { onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal" + triggerSubMenuAction="click" > Navigation One @@ -44,7 +45,7 @@ class App extends React.Component { Navigation Two - Navigation Three - Submenu}> + Navigation Three - Submenu}> Option 1 Option 2 diff --git a/components/menu/style/index.less b/components/menu/style/index.less index 1b3c004300..6d3c4b2129 100644 --- a/components/menu/style/index.less +++ b/components/menu/style/index.less @@ -179,6 +179,10 @@ position: absolute; border-radius: @border-radius-base; z-index: @zindex-dropdown; + + .submenu-title-wrapper { + padding-right: 20px; + } } > .@{menu-prefix-cls} { @@ -262,12 +266,13 @@ border-bottom: @border-width-base @border-style-base @border-color-split; box-shadow: none; line-height: 46px; + white-space: nowrap; > .@{menu-prefix-cls}-item, > .@{menu-prefix-cls}-submenu { position: relative; top: 1px; - float: left; + display: inline-block; border-bottom: 2px solid transparent; &:hover, -- GitLab