You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2022/04/11 21:20:47 UTC

[superset] branch master updated: fix: Table Autosizing Has Unnecessary Scroll Bars (#19628)

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 955413539b fix: Table Autosizing Has Unnecessary Scroll Bars (#19628)
955413539b is described below

commit 955413539b3edd892efd6bc069240efb5f5a29ac
Author: Diego Medina <di...@gmail.com>
AuthorDate: Mon Apr 11 17:20:41 2022 -0400

    fix: Table Autosizing Has Unnecessary Scroll Bars (#19628)
---
 .../plugins/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 240073210e..9a98fee431 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<HTMLTableHeaderCellElement>;
-    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,