Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
fixed bug prevent default answer from being displayed in Input - fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecAivazis committed Nov 18, 2020
1 parent 60b57e7 commit 825477e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion input.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,18 @@ func (i *Input) Prompt(config *PromptConfig) (interface{}, error) {
}

func (i *Input) Cleanup(config *PromptConfig, val interface{}) error {
ans := i.answer
if ans == "" && i.Default != "" {
ans = i.Default
}

return i.Render(
InputQuestionTemplate,
InputTemplateData{
Input: *i,
ShowAnswer: true,
Config: config,
Answer: i.answer,
Answer: ans,
},
)
}

0 comments on commit 825477e

Please sign in to comment.