From ab9e24177942f4630609b0432f4389cc4f6ec6db Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Fri, 15 Nov 2024 13:44:51 -0300 Subject: fix(table): only set height if > 0 closes #685 closes #660 --- table/command.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/table/command.go b/table/command.go index 1e08faf..6f9aca9 100644 --- a/table/command.go +++ b/table/command.go @@ -102,13 +102,16 @@ func (o Options) Run() error { return nil } - table := table.New( + opts := []table.Option{ table.WithColumns(columns), table.WithFocused(true), - table.WithHeight(o.Height), table.WithRows(rows), table.WithStyles(styles), - ) + } + if o.Height > 0 { + opts = append(opts, table.WithHeight(o.Height)) + } + table := table.New(opts...) tm, err := tea.NewProgram(model{table: table}, tea.WithOutput(os.Stderr)).Run() if err != nil { -- cgit v1.2.3