From 0f50e0458eeeffef2bd2f5b18cfb91192ab37d85 Mon Sep 17 00:00:00 2001 From: BlackTooth <39750199+xiaojieajie@users.noreply.github.com> Date: Tue, 5 Jul 2022 11:43:53 +0800 Subject: [PATCH] fix(useTableFooter): not synchronization scroll bug (#2022) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 隆杰 --- src/components/Table/src/hooks/useTableFooter.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Table/src/hooks/useTableFooter.ts b/src/components/Table/src/hooks/useTableFooter.ts index 12285eb03..6a3aa580a 100644 --- a/src/components/Table/src/hooks/useTableFooter.ts +++ b/src/components/Table/src/hooks/useTableFooter.ts @@ -36,14 +36,13 @@ export function useTableFooter( nextTick(() => { const tableEl = unref(tableElRef); if (!tableEl) return; - const bodyDomList = tableEl.$el.querySelectorAll('.ant-table-body'); - const bodyDom = bodyDomList[0]; + const bodyDom = tableEl.$el.querySelector('.ant-table-content'); useEventListener({ el: bodyDom, name: 'scroll', listener: () => { const footerBodyDom = tableEl.$el.querySelector( - '.ant-table-footer .ant-table-body', + '.ant-table-footer .ant-table-content', ) as HTMLDivElement; if (!footerBodyDom || !bodyDom) return; footerBodyDom.scrollLeft = bodyDom.scrollLeft;