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
By doing that, we are always autocompleting the smallest possible option, avoiding errors in compound city names, for example.
My case
User wants to type "Salvador" (city in Brazil)
My DataSource array:
["são Paulo", "salvador do Sul", "macapa", "salvador"]
Problem:
Salvador do sul is autocompleted instead of Salvador because it goes first in the array, and since Salvador has less characters, it will never autocomplete.
Solution
always filter datasource from the smallest string to the biggest, so every single string will have the chance to be autocompleted
The text was updated successfully, but these errors were encountered:
By doing that, we are always autocompleting the smallest possible option, avoiding errors in compound city names, for example.
My case
User wants to type "Salvador" (city in Brazil)
My DataSource array:
["são Paulo", "salvador do Sul", "macapa", "salvador"]
Problem:
Salvador do sul is autocompleted instead of Salvador because it goes first in the array, and since Salvador has less characters, it will never autocomplete.
Solution
always filter datasource from the smallest string to the biggest, so every single string will have the chance to be autocompleted
The text was updated successfully, but these errors were encountered: