Skip to content

Commit

Permalink
fix(table): only set height if > 0
Browse files Browse the repository at this point in the history
closes #685
closes #660
  • Loading branch information
caarlos0 committed Nov 15, 2024
1 parent c3ce2f9 commit ab9e241
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions table/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ab9e241

Please sign in to comment.