select captures previous enter key as input
joshuamarquez opened this issue · comments
Joshua Marquez commented
before select is executed, if enter key is pressed this one will be captured as input for select misleading to undesired behavior.
code to reproduce
package main
import (
"fmt"
"time"
"github.com/manifoldco/promptui"
)
func main() {
fmt.Println("press 'enter key' to reproduce behaviour")
time.Sleep(5000 * time.Millisecond)
prompt := promptui.Select{
Label: "Select Day",
Items: []string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"},
}
_, result, err := prompt.Run()
if err != nil {
fmt.Printf("Prompt failed %v\n", err)
return
}
fmt.Printf("You choose %q\n", result)
}