@fundamental-ngx/platform 0.66.0-rc.6 → 0.66.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3911,10 +3911,17 @@ class TableVirtualScrollDirective extends TableVirtualScroll {
3911
3911
  }
3912
3912
  /** @hidden */
3913
3913
  _getNumberOfRowsToDisplay() {
3914
- const tableContainer = this._table.tableContainer.nativeElement;
3915
- let tableHeight = tableContainer.clientHeight;
3916
- tableHeight = tableHeight - tableContainer.querySelector('thead').clientHeight;
3917
- const numberOfRows = Math.floor(tableHeight / this.rowHeight);
3914
+ // The scroll viewport excludes the space occupied by a horizontal scrollbar.
3915
+ const scrollViewport = this._table.tableScrollable.elementRef.nativeElement;
3916
+ let tableHeight = scrollViewport.clientHeight;
3917
+ tableHeight = tableHeight - (scrollViewport.querySelector('thead')?.clientHeight ?? 0);
3918
+ const renderedRows = scrollViewport.querySelectorAll('tbody[fd-table-body] > tr');
3919
+ // Cell controls and borders can make rows taller than the configured minimum.
3920
+ let rowHeight = this.rowHeight;
3921
+ for (const row of renderedRows) {
3922
+ rowHeight = Math.max(rowHeight, row.offsetHeight);
3923
+ }
3924
+ const numberOfRows = Math.floor(tableHeight / rowHeight);
3918
3925
  if (this._table._tableRowsVisible.length < numberOfRows) {
3919
3926
  return this._table._tableRowsVisible.length;
3920
3927
  }