Skip to content

Commit 33f7b48

Browse files
committed
fix: table fixed column not show dropdown
1 parent 987c387 commit 33f7b48

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

components/table/filterDropdown.tsx

+2-27
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { reactive, defineComponent, nextTick, computed, watch } from 'vue';
22
import FilterFilled from '@ant-design/icons-vue/FilterFilled';
33
import Menu, { SubMenu, MenuItem } from '../menu';
4-
import closest from '../_util/dom-closest';
54
import classNames from '../_util/classNames';
65
import shallowequal from '../_util/shallowequal';
76
import Dropdown from '../dropdown';
87
import Checkbox from '../checkbox';
98
import Radio from '../radio';
109
import FilterDropdownMenuWrapper from './FilterDropdownMenuWrapper';
1110
import { FilterMenuProps } from './interface';
12-
import { isValidElement, findDOMNode } from '../_util/props-util';
11+
import { isValidElement } from '../_util/props-util';
1312
import initDefaultProps from '../_util/props-util/initDefaultProps';
1413
import { cloneElement } from '../_util/vnode';
1514
import BaseMixin2 from '../_util/BaseMixin2';
@@ -67,33 +66,9 @@ export default defineComponent({
6766
// );
6867
return state;
6968
},
70-
71-
mounted() {
72-
const { column } = this;
73-
nextTick(() => {
74-
this.setNeverShown(column);
75-
});
76-
},
77-
updated() {
78-
const { column } = this;
79-
nextTick(() => {
80-
this.setNeverShown(column);
81-
});
82-
},
8369
methods: {
8470
getDropdownVisible() {
85-
return this.neverShown ? false : this.sVisible;
86-
},
87-
setNeverShown(column) {
88-
const rootNode = findDOMNode(this);
89-
const filterBelongToScrollBody = !!closest(rootNode, `.ant-table-scroll`);
90-
if (filterBelongToScrollBody) {
91-
// When fixed column have filters, there will be two dropdown menus
92-
// Filter dropdown menu inside scroll body should never be shown
93-
// To fix https://github.com/ant-design/ant-design/issues/5010 and
94-
// https://github.com/ant-design/ant-design/issues/7909
95-
this.neverShown = !!column.fixed;
96-
}
71+
return !!this.sVisible;
9772
},
9873

9974
setSelectedKeys({ selectedKeys }) {

0 commit comments

Comments
 (0)