onmotion / react-native-autocomplete-dropdown

Dropdown Item picker with search and autocomplete (typeahead) functionality for react native
MIT License
201 stars 79 forks source link

Added support for diacritics, match suggestions from start, expose blur function #90

Closed dravec closed 1 year ago

dravec commented 1 year ago

I have made several improvements to my fork that you might consider to accept into the official module :

  1. I added a parameter ignoreAccents that ignores diacritics (characters like š, č, á etc) in the autocomplete suggestions. Defaults to true as it should be in my opinion.
  2. I added a parameter matchFrom with possible values any or start, defaults to any. If start is used, the suggestions match only from the start of the string and not randomly in the middle.
  3. I exposed the blur function, because the close() method called from outside using controller does not work in version 3 ( it worked fine in version 2) - it will not close because the input box has focus on it. So I have to use blur() and close() in order to close the dropdown. You might consider to add blur() into the close() functions but I was not sure about the consequences, so I decided only to expose the blur() function and just called it before close(). Exposing a blur() function is a good idea anyway I think.