Closed MedeaMelana closed 3 years ago
Hey @MedeaMelana - thanks for reporting this!
The searchCustom
function isn't supposed to be super intelligent, just a quick utility, but you make a good point.
Would country.name ++ " " ++ country.code
behave more consistently for your expectations?
Hi @supermario, no I think the right way to do it is:
\country ->
String.contains (String.toLower searchString) (String.toLower country.name) ||
String.contains (String.toLower searchString) (String.toLower country.code)
Cool, that makes sense.
This change is released in v1.1.1, thanks @MedeaMelana !
From reading the source code of
searchCustom
, I noticed what I think is a bug: by checking if the query is a substring ofcountry.name ++ country.code
, you'd get Andorra (and a few other countries) as a result for query "aa" even though no "aa" appears in either the country name or code individually. For query "aa" I would expect "Sint Maarten (Dutch part)" to be the only result.