Skip to content

Commit

Permalink
fix: adjust page size to number of options
Browse files Browse the repository at this point in the history
  • Loading branch information
jfatta committed Mar 15, 2021
1 parent 7de6fa3 commit 815b787
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/prompt/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ func BoolInput(name string, message string, help string, required bool) *survey.
}

func SelectInput(name string, message string, help string, options []string, required bool) *survey.Question {
// force options "page" size to full,
// since there's not visual clue about extra options.
pageSize := len(options)
input := &survey.Question{
Name: name,
Prompt: &survey.Select{Message: message, Help: help, Options: options},
Prompt: &survey.Select{Message: message, Help: help, Options: options, PageSize: pageSize},
}

if required {
Expand Down

0 comments on commit 815b787

Please sign in to comment.