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

Closed
Hector-Work opened this issue Sep 24, 2024 · 1 comment · May be fixed by #450
Closed

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

Hector-Work opened this issue Sep 24, 2024 · 1 comment · May be fixed by #450
Labels
bug Something isn't working input select

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 :)

@caarlos0
Copy link
Member

caarlos0 commented Nov 27, 2024

this seems to be fixed on main.

thanks for the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working input select
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants