8

I need to implement AutoCompleteTextView in react native. The problem is that there is no such built-in component. All the modules and libraries available to mimic this feature is not completely similar. The main issue is the suggestions are not appearing over the view(like that of select box/picker). Even if it is then it is not behaving perfectly withKeyboardAvoidingView. The whole point is it is not working like native AutoCompleteTextView for Android

The other solution is using native UI element. But I want this component for both iOS and Android. Any help would be appreciated.

I want to achieve this option like tag user on the Facebook app I want to achieve this option like tag user on Facebook app I want to achieve this option like tag user on Facebook app

P.S.: Excuse the typos as I am using a mobile device.

2
  • What is your question? If you are asking for a recommendation of a module then that is off-topic.
    – Paulw11
    Commented Mar 7, 2018 at 19:59
  • Not exactly asking for recommendation of module. I want to know is it possible to create custom AutoCompleteTextView in React native. If yes, How?
    – Ashish
    Commented Mar 8, 2018 at 2:26

2 Answers 2

5

After searching a lot for available Libraries and module, I came up with my own implementation of custom AutoCompleteTextView.
I have created a gist for AutoCompleteTextView.
The idea behind:

*There is one input field on the focus of this field keyboard appears.

*When keyboard appears we calculate space from top to input field and from input field till the start of keypad area.

*Will display an absolute positioned scroll view Suggestion area on top or bottom of input field based on the space calculation above.

*When keyboard goes away we hide the suggestion area.

Suggestions are welcome on how to improve this thing.

Suggestions appearing on top of the input field Suggestions appearing below the input field and above keyboard

0

Here is the android native AutoCompleteTextView component - https://github.com/rajsuvariya/autocompletetextview - its a work in progress.

Not the answer you're looking for? Browse other questions tagged or ask your own question.