Skip to content

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

@jord-nijhuis

Description

@jord-nijhuis

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo 🕑

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions