From 690a0e685721b28800369d2c32346b7798eb8dfe Mon Sep 17 00:00:00 2001 From: bashbunni Date: Wed, 16 Oct 2024 20:56:44 -0700 Subject: [PATCH] feat(example): set table height based on window height --- examples/table/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/table/main.go b/examples/table/main.go index e7434ab1d0..24fcf1b149 100644 --- a/examples/table/main.go +++ b/examples/table/main.go @@ -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":