Open zlesnr opened 3 years ago
This behavior is defined by a template. Default template defines that only a selected value is printed without a label:
if tpls.Selected == "" {
tpls.Selected = fmt.Sprintf(`{{ "%s" | green }} {{ . | faint }}`, IconGood)
}
So, to fix the issues you have, you can override a default template like this:
prompt := promptui.Select{
Label: prefix,
Items: choices,
Templates: &promptui.SelectTemplates {
Selected: fmt.Sprintf(`%s: {{ . | faint }}`, prefix),
},
}
You can customize the output depending on your needs.
This confuses our users because they want to see what question they were asked, along with their answers as the interview continues. Is there a way to get the Label to remain in place along with the selection after the selection is made?