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

Support for disabled list entries? #29

Open
blackbit42 opened this issue Aug 8, 2019 · 3 comments
Open

Support for disabled list entries? #29

blackbit42 opened this issue Aug 8, 2019 · 3 comments

Comments

@blackbit42
Copy link

I have a use-case for pick where i want to display say items 1..8, but two of them, 3 and 6 are not viable options, but 'known' to the underlying system. The user shouldn't be able to select the not viable items, as that would make them expect that action is taken, whereas that is not the case, because it's not possible to do so. I want to be able to visualize that fact that these items are 'known' and not simply leave them out as the user wouldn't be able to differentiate between unknown and disabled items.

I can imagine two different ways to visually represent that.
I think option 1 is preferable, considering lists can be longer than a screen is high, making option 2 non-straight-forward to grasp):

  1. Keep the list and its ordering as provided to the pick function, visually differentiating the disabled from the enabled options (different color, prefix, something like that).
    Disabled options are skipped when navigating the list

  2. Presenting enabled and disabled items in two separate lists.

A necessary implication is that items passed to pick() must be tuples, indicating for each item whether it is enabled or disabled.

@wong2
Copy link
Collaborator

wong2 commented Jan 29, 2020

I'm not sure if it is a widely needed feature so I'll wait to see if there're more +1s. But PRs are always welcome!

@mkamran37
Copy link

I have a similar use case.

@chuan137
Copy link

chuan137 commented Feb 3, 2022

I think it makes sense to extend the option strings to a option class, with various customisation possibilities and styles. An option could be non-selectable, or purely text between option groups and etc.

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

No branches or pull requests

4 participants