From 29b7661c8a731fa1ab0d531d67e3469d277337d9 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 240073210ea3b..9a98fee431817 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,