Skip to content

Add Disabled State to Options #77

Open
@davidmdm

Description

Is your feature request related to a problem? Please describe.
We want to provide multiselects to users where some of the options are disabled.
Generally speaking we can filter our disabled options but for our use-case it would feel like missing context for our users.
It would be better if they could see the state of all their options even if specific options have been disabled from selection.

Describe the solution you'd like
It would be great if we could do:

 huh.NewMultiSelect[string]().
    Title("Toppings").
    Options(
        huh.NewOption("Lettuce", "lettuce").Selected(true),
        huh.NewOption("Tomatoes", "tomatoes").Disabled(true),
        ...

The result would be that Tomatoes may appear gray and/or strikethrough and could not be selected.
Perhaps the arrow functions would skip over its index entirely, or selection would be blocked or trigger some visual element.
I have no hard requirements as to user experience.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions