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
[BUG] The package filters online results even if isFilteredOnline is set to true, causing some results loaded via onFind to get filtered and removed.
#116
Closed
NamanShergill opened this issue
Feb 19, 2021
· 4 comments
For example, if one were to search "Delh" via the Nominatim API in the onFind param and return the results, one of the results would be "Valz-sous-Châteauneuf, Issoire, Puy-de-Dôme, Auvergne-Rhône-Alpes, Metropolitan France, 63580, France". This result would get filtered, even if the flag isFilteredOnline is set to true.
As you can see, it filters the result in else if (i.toString().toLowerCase().contains(filter.toLowerCase())), because technically "delh" is not in the string "Valz-sous-Châteauneuf, Issoire, Puy-de-Dôme, Auvergne-Rhône-Alpes, Metropolitan France, 63580, France", causing it to get filtered out.
Expected Behavior
Considering isFilteredOnline is set to true, the dropdown should show all results by default, considering the flag itself implies the filtering is already done online by the API.
How it might be fixed
The applyFilter function should not be used for the results given by the API in this scenario (unless the user specifically passes filterFn).
The text was updated successfully, but these errors were encountered:
How to reproduce
For example, if one were to search "Delh" via the Nominatim API in the
onFind
param and return the results, one of the results would be "Valz-sous-Châteauneuf, Issoire, Puy-de-Dôme, Auvergne-Rhône-Alpes, Metropolitan France, 63580, France". This result would get filtered, even if the flagisFilteredOnline
is set totrue
.What is causing this
searchable_dropdown/lib/src/selectDialog.dart
Line 225 in 70fa719
As you can see, it filters the result in
else if (i.toString().toLowerCase().contains(filter.toLowerCase()))
, because technically "delh" is not in the string "Valz-sous-Châteauneuf, Issoire, Puy-de-Dôme, Auvergne-Rhône-Alpes, Metropolitan France, 63580, France", causing it to get filtered out.Expected Behavior
Considering
isFilteredOnline
is set to true, the dropdown should show all results by default, considering the flag itself implies the filtering is already done online by the API.How it might be fixed
The applyFilter function should not be used for the results given by the API in this scenario (unless the user specifically passes
filterFn
).The text was updated successfully, but these errors were encountered: