Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shift+Tab doesn't go to previous field if Select OptionsFunc returns no options #422

Open
Hector-Work opened this issue Sep 24, 2024 · 0 comments · May be fixed by #450
Open

Shift+Tab doesn't go to previous field if Select OptionsFunc returns no options #422

Hector-Work opened this issue Sep 24, 2024 · 0 comments · May be fixed by #450

Comments

@Hector-Work
Copy link

Hector-Work commented Sep 24, 2024

Describe the bug
If you are focused on a Select field where the OptionsFunc has not returned any options, Shift+Tab doesn't return focus to the previous field.

To Reproduce
Steps to reproduce the behaviour:

search := ""

form := huh.NewForm(
  huh.NewGroup(
    huh.NewInput().
      Key("search").
      Value(&search).
      Title("Search"),
    huh.NewSelect[string]().
      OptionsFunc(func() []huh.Option[string] {
        return []huh.Option[string]{}
      }, &search).
      Title("Select"),
  ),
)

return form

Expected behaviour
The focus should return to the previous field.

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant