From 03b9fb7b7e9bafe0ae9672df9e1e0de521cac5fc Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 19 Aug 2024 11:49:24 -0300 Subject: [PATCH] fix: group size when height is 0 (#363) if height is not set, it will never actually work properly. refs https://github.com/charmbracelet/gum/issues/582 Signed-off-by: Carlos Alexandro Becker --- field_input.go | 2 +- group.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/field_input.go b/field_input.go index 6842c4f9..3510d527 100644 --- a/field_input.go +++ b/field_input.go @@ -36,7 +36,7 @@ type Input struct { accessible bool width int - height int + height int // not really used anywhere theme *Theme keymap InputKeyMap diff --git a/group.go b/group.go index 13375bac..147bc230 100644 --- a/group.go +++ b/group.go @@ -269,7 +269,7 @@ func (g *Group) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.WindowSizeMsg: - g.WithHeight(min(g.height, min(g.fullHeight(), msg.Height-1))) + g.WithHeight(max(g.height, min(g.fullHeight(), msg.Height-1))) case nextFieldMsg: cmds = append(cmds, g.nextField()...) case prevFieldMsg: