filter dropdown should have max height

This commit is contained in:
afc163 2015-12-10 12:13:13 +08:00
parent 397cfc96c0
commit b4789e585d
2 changed files with 25 additions and 7 deletions

View File

@ -61,15 +61,15 @@ let FilterMenu = React.createClass({
if ('filterMultiple' in column) {
multiple = column.filterMultiple;
}
let menus = <Menu multiple={multiple}
let menus = <div className="ant-table-filter-dropdown">
<Menu multiple={multiple}
prefixCls="ant-dropdown-menu"
className="ant-table-filter-dropdown"
onSelect={this.setSelectedKeys}
onDeselect={this.setSelectedKeys}
selectedKeys={this.state.selectedKeys}>
{this.renderMenus(column.filters)}
<Menu.Divider />
<Menu.Item disabled>
</Menu>
<div className="ant-table-filter-dropdown-btns">
<a className="ant-table-filter-dropdown-link confirm"
style={{
cursor: 'pointer',
@ -86,8 +86,8 @@ let FilterMenu = React.createClass({
onClick={this.handleClearFilters}>
{locale.filterReset}
</a>
</Menu.Item>
</Menu>;
</div>
</div>;
let dropdownSelectedClass = '';
if (this.props.selectedKeys.length > 0) {

View File

@ -221,11 +221,29 @@
.@{table-prefix-cls}-filter-dropdown {
min-width: 96px;
margin-left: -8px;
background: #fff;
border-radius: @border-radius-base;
border: 1px solid @border-color-base;
box-shadow: @box-shadow-base;
.ant-dropdown-menu {
max-height: 220px;
overflow: auto;
border: 0;
box-shadow: none;
}
.ant-dropdown-menu-item {
overflow: hidden;
}
.ant-dropdown-menu-item a&-link {
&-btns {
overflow: hidden;
padding: 7px 15px;
border-top: 1px solid @border-color-split;
}
&-link {
color: @link-color;
&:hover {
color: @link-hover-color;