From 955413539b3edd892efd6bc069240efb5f5a29ac Mon Sep 17 00:00:00 2001 From: Diego Medina Date: Mon, 11 Apr 2022 17:20:41 -0400 Subject: [PATCH] fix: Table Autosizing Has Unnecessary Scroll Bars (#19628) --- .../plugin-chart-table/src/DataTable/hooks/useSticky.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx index 240073210..9a98fee43 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx @@ -183,7 +183,9 @@ function StickyWrap({ .clientHeight; const ths = bodyThead.childNodes[0] .childNodes as NodeListOf; - const widths = Array.from(ths).map(th => th.clientWidth); + const widths = Array.from(ths).map( + th => th.getBoundingClientRect()?.width || th.clientWidth, + ); const [hasVerticalScroll, hasHorizontalScroll] = needScrollBar({ width: maxWidth, height: maxHeight - theadHeight - tfootHeight,