Skip to content

Commit

Permalink
feat(example): set table height based on window height
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Oct 17, 2024
1 parent 7f871e2 commit 690a0e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/table/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ func (m model) Init() tea.Cmd { return nil }
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmd tea.Cmd
switch msg := msg.(type) {
case tea.WindowSizeMsg:
m.table.SetHeight(msg.Height - 1)
case tea.KeyMsg:
switch msg.String() {
case "esc":
Expand Down

0 comments on commit 690a0e6

Please sign in to comment.