huh icon indicating copy to clipboard operation
huh copied to clipboard

Preceding a confirm dialog with a spinner causes the first input keystroke to be ignored

Open jherman opened this issue 6 months ago • 3 comments

Describe the bug As the title indicates, preceding a confirm dialog with a spinner causes the first input keystroke to be ignored.

To Reproduce


func main() {
	spinnerErr := spinner.
		New().
		Title("retrieving data...").
		Action(func() {
			time.Sleep(1 * time.Second)
		}).
		Run()
	if spinnerErr != nil {
		log.Fatal(spinnerErr)
	}

	var confirmed bool

	confirmErr := huh.NewConfirm().
		Title("Fix?").
		Value(&confirmed).
		Run()
	if confirmErr != nil {
		log.Fatal(confirmErr)
	}
}

Expected behavior first keystroke should be recognized

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser [e.g. chrome, safari] -
  • Version [e.g. 22] v0.5.2

jherman avatar Aug 20 '24 23:08 jherman