Autocomplete: Input-Field stays focused after selection

Autocomplete: Input-Field stays focused after selection

Hi there,

this is my first post and I hope you can help me solving a probleme i'm looking at for days now:

I do use Autocomplete with jqueryui for searching a json-file on an interactive map. By selection a value, the infowindow for a point shows up. Everything works fine, but one thing:
After clicking or touching a list-point, the infowindow shows up but the input field stays focused. Mobile that leads to the problem, that the keyboard stays open and overflows the infowindow. 

This is part of my code, can you help me out?

  1. $( "#autocomplete" ).autocomplete("option", "source", arr).click('focus', function(){ $(this).autocomplete("search"); } );

  2.         $("#autocomplete").autocomplete({
  3.            minLength: 0,
  4.             open: function(event, ui) {
  5.                 $('.ui-autocomplete').off('menufocus hover mouseover mouseenter');
  6.             }
  7.         });
  8.         $( "#autocomplete" ).on( "autocompleteselect", function( event, ui ) {
  9. polySelect(ui.item.label);
  10. ui.item.value='';
  11. });
  12. }

  13.   function polySelect(a){
  14. map._layers[a].fire('click'); 
  15. var stateLayer = map._layers[a];        
  16.         }