mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-12 20:43:11 +08:00
fix getPopupContainer not work (#20509)
This commit is contained in:
parent
f965d92aa8
commit
695b67b045
@ -895,6 +895,8 @@ describe('Table.filter', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should support getPopupContainer', () => {
|
it('should support getPopupContainer', () => {
|
||||||
|
const getPopupContainer = jest.fn(node => node.parentNode);
|
||||||
|
|
||||||
const wrapper = mount(
|
const wrapper = mount(
|
||||||
createTable({
|
createTable({
|
||||||
columns: [
|
columns: [
|
||||||
@ -903,10 +905,11 @@ describe('Table.filter', () => {
|
|||||||
filterDropdownVisible: true,
|
filterDropdownVisible: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
getPopupContainer: node => node.parentNode,
|
getPopupContainer,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
expect(wrapper.render()).toMatchSnapshot();
|
expect(wrapper.render()).toMatchSnapshot();
|
||||||
|
expect(getPopupContainer).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support getPopupContainer from ConfigProvider', () => {
|
it('should support getPopupContainer from ConfigProvider', () => {
|
||||||
|
@ -768,6 +768,12 @@ exports[`Table.filter should support getPopupContainer 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
style="position: absolute; top: 0px; left: 0px; width: 100%;"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
style="position: absolute; top: 0px; left: 0px; width: 100%;"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</th>
|
</th>
|
||||||
|
@ -237,6 +237,7 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
|
|||||||
trigger={['click']}
|
trigger={['click']}
|
||||||
visible={mergedVisible}
|
visible={mergedVisible}
|
||||||
onVisibleChange={onVisibleChange}
|
onVisibleChange={onVisibleChange}
|
||||||
|
getPopupContainer={getPopupContainer}
|
||||||
placement="bottomRight"
|
placement="bottomRight"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
Loading…
Reference in New Issue
Block a user