二货机器人
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
11 additions and
1 deletions
-
components/table/__tests__/Table.filter.test.js
-
components/table/__tests__/__snapshots__/Table.filter.test.js.snap
-
components/table/hooks/useFilter/FilterDropdown.tsx
|
|
@ -895,6 +895,8 @@ describe('Table.filter', () => { |
|
|
|
}); |
|
|
|
|
|
|
|
it('should support getPopupContainer', () => { |
|
|
|
const getPopupContainer = jest.fn(node => node.parentNode); |
|
|
|
|
|
|
|
const wrapper = mount( |
|
|
|
createTable({ |
|
|
|
columns: [ |
|
|
@ -903,10 +905,11 @@ describe('Table.filter', () => { |
|
|
|
filterDropdownVisible: true, |
|
|
|
}, |
|
|
|
], |
|
|
|
getPopupContainer: node => node.parentNode, |
|
|
|
getPopupContainer, |
|
|
|
}), |
|
|
|
); |
|
|
|
expect(wrapper.render()).toMatchSnapshot(); |
|
|
|
expect(getPopupContainer).toHaveBeenCalled(); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should support getPopupContainer from ConfigProvider', () => { |
|
|
|
|
|
@ -768,6 +768,12 @@ exports[`Table.filter should support getPopupContainer 1`] = ` |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
style="position: absolute; top: 0px; left: 0px; width: 100%;" |
|
|
|
/> |
|
|
|
<div |
|
|
|
style="position: absolute; top: 0px; left: 0px; width: 100%;" |
|
|
|
/> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</th> |
|
|
|
|
|
@ -237,6 +237,7 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) { |
|
|
|
trigger={['click']} |
|
|
|
visible={mergedVisible} |
|
|
|
onVisibleChange={onVisibleChange} |
|
|
|
getPopupContainer={getPopupContainer} |
|
|
|
placement="bottomRight" |
|
|
|
> |
|
|
|
<span |
|
|
|