From 4d377339ea8ce56897ffa597a0fefc295457d4b4 Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Mon, 15 Jul 2024 21:36:36 -0700 Subject: [PATCH] Fix TableLayout issues --- packages/@react-spectrum/table/src/TableViewLayout.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/@react-spectrum/table/src/TableViewLayout.ts b/packages/@react-spectrum/table/src/TableViewLayout.ts index 483d39a0b42..400ce240c27 100644 --- a/packages/@react-spectrum/table/src/TableViewLayout.ts +++ b/packages/@react-spectrum/table/src/TableViewLayout.ts @@ -36,7 +36,7 @@ export class TableViewLayout extends TableLayout { if (this.isLoading) { // Add some margin around the loader to ensure that scrollbars don't flicker in and out. - let rect = new Rect(40, Math.max(layoutInfo.rect.maxY, 40), (width || this.virtualizer.visibleRect.width) - 80, children.length === 0 ? this.virtualizer.visibleRect.height - 80 : 60); + let rect = new Rect(40, children.length === 0 ? 40 : layoutInfo.rect.maxY, (width || this.virtualizer.visibleRect.width) - 80, children.length === 0 ? this.virtualizer.visibleRect.height - 80 : 60); let loader = new LayoutInfo('loader', 'loader', rect); loader.parentKey = layoutInfo.key; loader.isSticky = children.length === 0; @@ -71,6 +71,14 @@ export class TableViewLayout extends TableLayout { return res; } + protected buildCell(node: GridNode, x: number, y: number): LayoutNode { + let res = super.buildCell(node, x, y); + if (node.column?.props.hideHeader) { + res.layoutInfo.allowOverflow = true; + } + return res; + } + protected getEstimatedRowHeight(): number { return super.getEstimatedRowHeight() + 1; // for bottom border }