esentis / multiple_search_selection

A highly customizable multiple selection widget with fuzzy search functionality.
https://pub.dev/packages/multiple_search_selection
BSD 3-Clause "New" or "Revised" License
11 stars 13 forks source link

Hide items until a certain number of characters are entered into search #51

Closed mdavo6 closed 3 months ago

mdavo6 commented 3 months ago

Describe the feature you'd like

Firstly thank you for the excellent widget, we use it throughout our app.

Our use case is to add a user to a project. There is a list of all users who have signed up to the app that they can select from, however from a privacy perspective we do not want the user to be able to see all users. The list of users should be hidden and only show up when the user has entered a number of characters into the search field (lets say 3). It feels like there should be a simple way to add this functionality, for example with a new itemVisibility option (for example ShowedItemsVisibility.onEntered(3)).

Describe alternatives you've considered

I have tried working with onSearchChanged using the new multipleSearchController, and considered editing the text entered into SearchField, but I feel like I am fighting with the existing code and can't seem to find a simple solution. Perhaps I am overlooking something?

Thanks again!

esentis commented 3 months ago

Hello @mdavo6 and thanks for taking the time to fill the feature request :)

Indeed there is no straightforward way to do this with the current version, but it will be nice addition ! I'll work on it asap, prolly this weekend.

Cheers !

mdavo6 commented 3 months ago

No worries @esentis . I'm glad it was not just me missing something. That would be fantastic. Thank you!

esentis commented 3 months ago

I've added minCharsToShowItems parameter to MultipleSearchController to delay the search operation until the user has typed a minimum number of characters as requested with version 2.6.4 !