mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
🐛 Fix Table filter submenu checkbox margin
https://user-images.githubusercontent.com/507615/65814464-a5c6c000-e214-11e9-8085-2c6fb1f5c6f2.png
This commit is contained in:
parent
d41b5be377
commit
e1a4f2891e
@ -146,7 +146,6 @@ class FilterMenu<T> extends React.Component<FilterMenuProps<T>, FilterMenuState<
|
||||
const { keyPathOfSelectedItem } = this.state;
|
||||
if (selectedKeys && selectedKeys.indexOf(info.key) >= 0) {
|
||||
// deselect SubMenu child
|
||||
console.log('delete keyPathOfSelectedItem[info.key]');
|
||||
delete keyPathOfSelectedItem[info.key];
|
||||
} else {
|
||||
// select SubMenu child
|
||||
@ -178,17 +177,18 @@ class FilterMenu<T> extends React.Component<FilterMenuProps<T>, FilterMenuState<
|
||||
}
|
||||
|
||||
renderMenus(items: ColumnFilterItem[]): React.ReactElement<any>[] {
|
||||
const { dropdownPrefixCls, prefixCls } = this.props;
|
||||
return items.map(item => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
const { keyPathOfSelectedItem } = this.state;
|
||||
const containSelected = Object.keys(keyPathOfSelectedItem).some(
|
||||
key => keyPathOfSelectedItem[key].indexOf(item.value) >= 0,
|
||||
);
|
||||
const subMenuCls = containSelected
|
||||
? `${this.props.dropdownPrefixCls}-submenu-contain-selected`
|
||||
: '';
|
||||
const subMenuCls = classNames(`${prefixCls}-dropdown-submenu`, {
|
||||
[`${dropdownPrefixCls}-submenu-contain-selected`]: containSelected,
|
||||
});
|
||||
return (
|
||||
<SubMenu title={item.text} className={subMenuCls} key={item.value.toString()}>
|
||||
<SubMenu title={item.text} popupClassName={subMenuCls} key={item.value.toString()}>
|
||||
{this.renderMenus(item.children)}
|
||||
</SubMenu>
|
||||
);
|
||||
|
@ -477,10 +477,6 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.@{ant-prefix}-checkbox-wrapper + span {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
> .@{ant-prefix}-dropdown-menu > .@{ant-prefix}-dropdown-menu-item:last-child,
|
||||
> .@{ant-prefix}-dropdown-menu
|
||||
> .@{ant-prefix}-dropdown-menu-submenu:last-child
|
||||
@ -777,6 +773,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
.@{table-prefix-cls}-filter-dropdown {
|
||||
&,
|
||||
&-submenu {
|
||||
.@{ant-prefix}-checkbox-wrapper + span {
|
||||
padding-left: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Another fix of Firefox:
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user