Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android auto complete only after space?

I have an application built in Html5 and wrapped in PhoneGap for Android

I have an auto-complete input

On a computer auto-complete input works great!

In SmartPhone, the auto-complete works only after you make space on the Input

(If write numbers first - works! If letters - works only after space)

Why?

JS code:

//Run in document.ready
function AutoComplete() {
    List = $.map(data.XXX, function (item) {
                return {
                    label: item.X,
                    value: item.XX
                };

            });
    $("#MyInput").autocomplete({
                source: List,
                link: '#',
                target: $('#MyList'),
                minLength: 1
            });

   }

HTML:

The input:

 <input id="MyInput" type="text" 
                placeholder="XXX"  />

The List:

  <ul id="MyList" data-role="listview" data-inset="true"> </ul>
like image 792
Hodaya Shalom Avatar asked Dec 20 '12 11:12

Hodaya Shalom


2 Answers

Try adding autocomplete="off" to the input tag.

like image 78
Raymond Camden Avatar answered Oct 06 '22 16:10

Raymond Camden


I am not sure ,but try after giving

     minlength :0

and execute the autocomplete on keypress

may be this will give u output.

have a look at these links also

  1. link1
  2. link2
like image 28
sourcecode Avatar answered Oct 06 '22 16:10

sourcecode