From 6dbfc8284dc365b0c733e95eb38878e906329955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Wi=C4=99cek?= Date: Wed, 13 Mar 2024 19:31:42 +0100 Subject: [PATCH] fix(table): substract headers Y size from the total table size (#434) * fix(table): substract headers Y size from the total table size * fix: change GetFrameSize to GetVerticalFrameSize and calc header height * fix: remove GetVerticalFrameSize at all * fix: account for headers in height WithHeight, SetHeight --------- Co-authored-by: Maas Lalani --- table/table.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/table/table.go b/table/table.go index 3ecb94b..f0064fc 100644 --- a/table/table.go +++ b/table/table.go @@ -163,7 +163,7 @@ func WithRows(rows []Row) Option { // WithHeight sets the height of the table. func WithHeight(h int) Option { return func(m *Model) { - m.viewport.Height = h + m.viewport.Height = h - lipgloss.Height(m.headersView()) } } @@ -314,7 +314,7 @@ func (m *Model) SetWidth(w int) { // SetHeight sets the height of the viewport of the table. func (m *Model) SetHeight(h int) { - m.viewport.Height = h + m.viewport.Height = h - lipgloss.Height(m.headersView()) m.UpdateViewport() }