Facing issues with Jquery Mobile and jquery ui autcomplete feature

Facing issues with Jquery Mobile and jquery ui autcomplete feature

This is the way i am using autocomplete for my jquery mobile application which is using jquery ui  


  1.     <input type="text" id="iamat"  name="iamat" onkeypress="return nospecialCharacters(event)" required/>
  2.     <div class="autoSearch_result_Wrap" id="iamatsearch" name="iamatsearch"></div>


  3.       $("#iamat").autocomplete(
  4.       {
  5.         source: function(request, response)
  6.         {
  7.           var iamat = $.trim($("#iamat").val());
  8.             $.ajax(
  9.             {
  10.                  success: function(data)
  11.               {
  12.                 var result = [];
  13.                 jsondata = data;
  14.                 for (var i = 0; i < data.length; i++)
  15.                 {
  16.                   result.push(data[i].vendor_name)
  17.                 }
  18.                 response(result);
  19.               },
  20.               error: function(x, t, m)
  21.               {
  22.                 if (t === "timeout")
  23.                 {
  24.                   alert("got timeout , please try again");
  25.                 }
  26.                 else
  27.                 {}
  28.               }
  29.             });
  30.           
  31.         },
  32.         minLength: 2,
  33.         appendTo: "#iamatsearch",
  34.         select: function(event, ui)
  35.         {
  36.           $("#iamat").val(ui.item.label);
  37.           $("#tablenum").focus();
  38.           return false;
  39.         }
  40.       });



There  are two issues i am facing is that

1  . Sometimes the autosuggested text displayed is not cleared .

2 . Sometimes the selected text remains for some  seconds  on top left of the page during page navigation 

Could you please let me know how to resolve ??




anyway not sure about the css , 




.autoSearch_result_Wrap{

        width: 100%;

        float: left;

        /*position: absolute;*/

      position:relative;

        margin-top: -9px;

        z-index: 9;
}
.autoSearch_result_Wrap ul{

      width:100%;

      float:left;

        background: #f6f6f6;

        width: 100%;

        list-style: none;

        padding: 0px;

        margin: 0px;  

        -webkit-box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.22);

                box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.22);
}
.autoSearch_result_Wrap ul li{

      list-style:none;

      margin:0px;

        padding: 15px;

        border-bottom: 1px solid #eee;

      cursor:pointer;
}
.autoSearch_result_Wrap ul li:last-child{

        border-bottom: 0px;
}
.autoSearch_result_Wrap ul li:hover{

      background:#d03e43;

      color:#fff;

        border-bottom: 1px solid #d03e43;
}