feat: add disabled items support in multiselect#319
Draft
omertuc wants to merge 1 commit intoconsole-rs:mainfrom
Draft
feat: add disabled items support in multiselect#319omertuc wants to merge 1 commit intoconsole-rs:mainfrom
omertuc wants to merge 1 commit intoconsole-rs:mainfrom
Conversation
Sometimes it's nice to show a user a list of options, some of which the user cannot interact with. e.g. A list of linux users on this machine to import to a new machine, I would like to show root but without allowing the user to deselect it. Current implementation limitations: - No theme support - there's no indication that an item is disabled until the user attempts to interact with it. Would adding such visual indication be a good idea from a compatibility perspective? Are themes all built-in or possibly user defined? - Cannot dynamically add items with a different disabled state. This would require modifying the signature of e.g. `item_checked` which would be a breaking change. I could also add a new method but I wasn't sure if it's worth it. - No tests - No documentation Do you think this is a desired feature? If so, I can work on improving the limitations. Should this maybe be a separate widget altogether?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sometimes it's nice to show a user a list of options, some of which the user cannot interact with.
e.g. A list of linux users on this machine to import to a new machine, I would like to show root but without allowing the user to deselect it.
Current implementation limitations:
No theme support - there's no indication that an item is disabled until the user attempts to interact with it. Would adding such visual indication be a good idea from a compatibility perspective? Are themes all built-in or possibly user defined?
Cannot dynamically add items with a different disabled state. This would require modifying the signature of e.g.
item_checkedwhich would be a breaking change. I could also add a new method but I wasn't sure if it's worth it.No tests
No documentation
Do you think this is a desired feature? If so, I can work on improving the limitations. Should this maybe be a separate widget altogether?