table height fix

This commit is contained in:
Will McGugan
2022-10-08 14:44:58 +01:00
parent cf438a5943
commit 8e6f2b7ae0
2 changed files with 3 additions and 2 deletions

View File

@@ -76,7 +76,7 @@ class ScrollView(Widget):
self._size = size
virtual_size = self.virtual_size
self._scroll_update(virtual_size)
self._container_size = size
self._container_size = size - self.styles.gutter.totals
self.scroll_to(self.scroll_x, self.scroll_y, animate=False)
self.refresh()

View File

@@ -269,9 +269,10 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
column.content_width = max(column.content_width, content_width)
total_width = sum(column.render_width for column in self.columns)
header_height = self.header_height if self.show_header else 0
self.virtual_size = Size(
total_width,
max(len(self._y_offsets), (self.header_height if self.show_header else 0)),
len(self._y_offsets) + header_height,
)
def _get_cell_region(self, row_index: int, column_index: int) -> Region: