From 1c298e4edfe9f483dca8524fca5c7f8805d93a89 Mon Sep 17 00:00:00 2001 From: Flcwl Date: Tue, 16 Aug 2022 17:10:16 +0800 Subject: [PATCH] fix(table): fix scrollWidth not work --- packages/ui/table/src/TableBody.tsx | 6 +++++- packages/ui/table/src/use-table.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ui/table/src/TableBody.tsx b/packages/ui/table/src/TableBody.tsx index 45c3020d6..75d3643cd 100644 --- a/packages/ui/table/src/TableBody.tsx +++ b/packages/ui/table/src/TableBody.tsx @@ -28,6 +28,7 @@ export const TableBody = forwardRef( onTableBodyScroll, maxHeight, canScroll, + scrollWidth, hasAvgColumn, avgRow, hasSumColumn, @@ -69,7 +70,10 @@ export const TableBody = forwardRef( overflowX: canScroll ? 'scroll' : undefined, }} > - +
{leafColumns.map((col: any, idx) => { return ( diff --git a/packages/ui/table/src/use-table.ts b/packages/ui/table/src/use-table.ts index 9bcccfd19..b01415002 100644 --- a/packages/ui/table/src/use-table.ts +++ b/packages/ui/table/src/use-table.ts @@ -532,6 +532,7 @@ export const useTable = ({ return { rootProps, + scrollWidth, activeSorterColumn, setActiveSorterColumn, activeSorterType,