Skip to content

Commit

Permalink
fix: group size when height is 0 (#363)
Browse files Browse the repository at this point in the history
if height is not set, it will never actually work properly.

refs charmbracelet/gum#582

Signed-off-by: Carlos Alexandro Becker <[email protected]>
  • Loading branch information
caarlos0 authored Aug 19, 2024
1 parent 0fd2415 commit 03b9fb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion field_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Input struct {

accessible bool
width int
height int
height int // not really used anywhere

theme *Theme
keymap InputKeyMap
Expand Down
2 changes: 1 addition & 1 deletion group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 03b9fb7

Please sign in to comment.