#720·huh

Allow user to go back in form when current input is invalid

Author: iocalebsCreated Dec 25, 2025Updated Jan 7, 2026

Description

If a form input is in an invalid state, the user is "stuck" on that input until they fix it—they can't move forward or backward.

Shouldn't a user still be able to go back in the form and change previous inputs before proceeding? Especially if the validity of input B depends on the value of input A...

Current behaviour

go
	form := huh.NewForm(
		huh.NewGroup(
			huh.NewInput().
				Title("Input A"),
			huh.NewInput().
				Title("Input B").
				// can't move back to A until entering a value for B
				Validate(huh.ValidateNotEmpty()),
		),
	)

	form.Run()
Image

Above screenshot shows state after trying to shift+tab back from input B to input A.

Desired behaviour

Allow user to go backwards - only prevent them from moving forward past the invalid input.