diff --git a/packages/core/src/data-editor/data-editor.tsx b/packages/core/src/data-editor/data-editor.tsx index b3809f8a9..97850433e 100644 --- a/packages/core/src/data-editor/data-editor.tsx +++ b/packages/core/src/data-editor/data-editor.tsx @@ -2578,17 +2578,18 @@ const DataEditorImpl: React.ForwardRefRenderFunction { let h: number; const scrollbarWidth = getScrollBarWidth(); + const rowsCountWithTrailingRow = rows + (showTrailingBlankRow ? 1 : 0); if (typeof rowHeight === "number") { - h = totalHeaderHeight + rows * rowHeight; + h = totalHeaderHeight + rowsCountWithTrailingRow * rowHeight; } else { let avg = 0; - const toAverage = Math.min(rows, 10); + const toAverage = Math.min(rowsCountWithTrailingRow, 10); for (let i = 0; i < toAverage; i++) { avg += rowHeight(i); } avg = Math.floor(avg / toAverage); - h = totalHeaderHeight + rows * avg; + h = totalHeaderHeight + rowsCountWithTrailingRow * avg; } h += scrollbarWidth; @@ -2597,7 +2598,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction