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

Allow for multiple matching search result items with the SelectionPrompt #1546

Open
jord-nijhuis opened this issue May 14, 2024 · 0 comments

Comments

@jord-nijhuis
Copy link

Is your feature request related to a problem? Please describe.
Right now, the SelectionPrompt<T>.EnableSearch() only allows for one matching search item with the search query (see ListPromptState.cs#L132).

This can be annoying if there are multiple items that match the search, but are not close together in the list

Describe the solution you'd like
Instead of letting the search function move the index, let the search function filter the list items that are rendered.

If you have a list with four items (orange, apple, banana, and more apples) and you enter apple as the search query, this is the current behavior:

orange
apple <-- cursor is here
banana
more apples

Instead, I'd propose the following:

apple <-- cursor is here
more apples

Describe alternatives you've considered
An alternative is to allow iterating over the items that match the search query without filtering out non-matching items. The user could use the arrow keys to iterate through the search items for example.


Please upvote 👍 this issue if you are interested in it.

@jord-nijhuis jord-nijhuis changed the title Allow for multiple matching search result items Allow for multiple matching search result items with the SelectionPrompt May 14, 2024
@github-project-automation github-project-automation bot moved this to Todo 🕑 in Spectre Console May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo 🕑
Development

No branches or pull requests

1 participant