fix: Table Autosizing Has Unnecessary Scroll Bars (#19628)

This commit is contained in:
Diego Medina 2022-04-11 17:20:41 -04:00 committed by GitHub
parent d8b9e72682
commit 955413539b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,