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

docs(example): simple example showing conditional options #75

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

meowgorithm
Copy link
Member

How we might go about officially something like this is a larger topic, but for now here's an example on how one can get started with forms that change based on user choices.

This was referenced Dec 19, 2023
@safaci2000
Copy link

Thank you for this, it's almost exactly what I was looking for. Would also love a way to integrate multiple forms with bubble tea. I tried to have an array of forms to have dynamic form behavior and was not able to get it working properly.

@meowgorithm
Copy link
Member Author

Thank you for this, it's almost exactly what I was looking for. Would also love a way to integrate multiple forms with bubble tea. I tried to have an array of forms to have dynamic form behavior and was not able to get it working properly.

Totally possible. If you want to open a discussion in the meantime with some (simple) source code would be happy to offer some help.

@meowgorithm
Copy link
Member Author

Note: this PR should be refactored to use @caarlos0’s excellent HideFunc.

meowgorithm and others added 2 commits January 24, 2024 17:41
this allows the form to be navigated and the user to choose another
option by going back.
@maaslalani
Copy link
Contributor

@meowgorithm, refactored this PR to use WithHideFunc makes it so the user can go back and make a different selection which is great!

@maaslalani maaslalani merged commit 0350ef6 into main Jan 24, 2024
40 checks passed
ardnew pushed a commit to ardnew/huh that referenced this pull request Apr 9, 2024
…let#75)

* docs(example): simple example showing conditional options

* refactor: conditional to use WithHideFunc groups

this allows the form to be navigated and the user to choose another
option by going back.

---------

Co-authored-by: Maas Lalani <maas@lalani.dev>
@maaslalani maaslalani deleted the conditional-example branch May 25, 2024 17:16
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 this pull request may close these issues.

3 participants