Commit 0f50e0458eeeffef2bd2f5b18cfb91192ab37d85
Committed by
GitHub
1 parent
4730b3af
fix(useTableFooter): not synchronization scroll bug (#2022)
Co-authored-by: 隆杰 <longjie.li@taxsoyea.net>
Showing
1 changed file
with
2 additions
and
3 deletions
src/components/Table/src/hooks/useTableFooter.ts
... | ... | @@ -36,14 +36,13 @@ export function useTableFooter( |
36 | 36 | nextTick(() => { |
37 | 37 | const tableEl = unref(tableElRef); |
38 | 38 | if (!tableEl) return; |
39 | - const bodyDomList = tableEl.$el.querySelectorAll('.ant-table-body'); | |
40 | - const bodyDom = bodyDomList[0]; | |
39 | + const bodyDom = tableEl.$el.querySelector('.ant-table-content'); | |
41 | 40 | useEventListener({ |
42 | 41 | el: bodyDom, |
43 | 42 | name: 'scroll', |
44 | 43 | listener: () => { |
45 | 44 | const footerBodyDom = tableEl.$el.querySelector( |
46 | - '.ant-table-footer .ant-table-body', | |
45 | + '.ant-table-footer .ant-table-content', | |
47 | 46 | ) as HTMLDivElement; |
48 | 47 | if (!footerBodyDom || !bodyDom) return; |
49 | 48 | footerBodyDom.scrollLeft = bodyDom.scrollLeft; | ... | ... |