Read initial visible state from column.filterDropdownVisible if it's available. (#4182)

fix #4162
This commit is contained in:
Wei Zhu 2016-12-08 11:18:35 +08:00 committed by GitHub
parent e1efc29150
commit 66f7b050eb
2 changed files with 5 additions and 2 deletions

View File

@ -30,10 +30,13 @@ export default class FilterMenu extends React.Component<FilterMenuProps, any> {
constructor(props) {
super(props);
const visible = ('filterDropdownVisible' in props.column) ?
props.column.filterDropdownVisible : false;
this.state = {
selectedKeys: props.selectedKeys,
keyPathOfSelectedItem: {}, // 记录所有有选中子菜单的祖先菜单
visible: false,
visible,
};
}

View File

@ -81,7 +81,7 @@ describe('Table.filter', () => {
expect(renderToJson(dropdownWrapper)).toMatchSnapshot();
});
xit('can be controlled by filterDropdownVisible', () => {
it('can be controlled by filterDropdownVisible', () => {
const wrapper = mount(createTable({
columns: [{
...column,