You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Right now, when using SelectionPrompt<T>.EnableSearch(), the search function will always be a String.Contains() see (ListPromptState.cs#L129).
It would be nice to allow for alternate searching strategies.
Describe the solution you'd like
A possible solution is to add an optional parameter to SelectionPrompt<T>.EnableSearch that is a Func<string, ListPromptItem<T>>, bool> that allows the user to provide a custom function that filters the items based on the search input.
If you want to search based on the start of the string, for example, you could do:
Describe alternatives you've considered
An alternative option would be to add a separate method for setting the search function, instead of using SelectionPrompt<T>.EnableSearch.
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Right now, when using
SelectionPrompt<T>.EnableSearch()
, the search function will always be aString.Contains()
see (ListPromptState.cs#L129).It would be nice to allow for alternate searching strategies.
Describe the solution you'd like
A possible solution is to add an optional parameter to
SelectionPrompt<T>.EnableSearch
that is aFunc<string, ListPromptItem<T>>, bool>
that allows the user to provide a custom function that filters the items based on the search input.If you want to search based on the start of the string, for example, you could do:
Describe alternatives you've considered
An alternative option would be to add a separate method for setting the search function, instead of using
SelectionPrompt<T>.EnableSearch
.Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered: