-
Notifications
You must be signed in to change notification settings - Fork 359
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
[Feature] Bring back minCharsForSuggestions property #609
Comments
Have you tried hideOnEmpty property?
|
Yes, I tried but it is not suitable for my case. Because I show add new button if the suggestion list is empty. If I use hideOnEmpty option nothing is shown. minCharsForSuggestions was perfect, why it was removed at all? |
I had the same feeling when first upgraded because of a similar use case; I don't want |
Nice catch :) |
We have intentionally removed this feature to reduce package complexity and chosen to instead empower users through other means, such as returning |
Use case
I have been using your library for 2 years and it was a perfect fit for my project. But you removed
minCharsForSuggestions
property with version 5.0.0 and suggested checking string length atsuggestionsCallback
.If I was using this widget in one screen it could be manageable but I am using this widget almost in 20 different widgets so I created the AutoCompleteTextField widget for myself which is using your widget.
This means I had to add dozens of screens' char length check to show suggestions. Instead of doing this chore, I wrote below code
suggestionsCallback: (search) => search.isNotEmpty && search.length >= 3 ? widget.suggestionsCallback(search) : [],
If it was enough, this could be OK, but it is not. The
minCharsForSuggestions
value also hide emptyBuilder if the value was below the threshold. With this new implementation, when the field gets focus, it automatically shows emptyBuilder, which is unwanted because the user hasn't typed anything yet.Now I am trying to find a way to bypass this behaviour.
Proposal
Bring back
minCharsForSuggestions
property like version 4.xThe text was updated successfully, but these errors were encountered: