jeudi 23 janvier 2020

Mouse Click not working for google.maps.places.Autocomplete

I have an issue with google.maps.places.Autocomplete, strangely the same code is working OK on another page with all other similar assets except the input control is in a div that is displayed using slick slider on the page where i am having the issue . On this page I still can use keyboard keys to select the search results. But when I try to left click using mouse on search results, it do not change any thing infact the result div is not being hidden if I click some where else on page. Somehow Google Api is not binding click events to Search Results when input control is in sliding div.

Following is my code. Please help.

 var _g_autocomplete;
function initializeGoogleSearch() {
  var crtlId = 'txtSearchInput';
  _g_autocomplete = new google.maps.places.Autocomplete(
      /** @type {HTMLInputElement} */(document.getElementById(crtlId)),
      { types: ['geocode'] });
  google.maps.event.addListener(_g_autocomplete, 'place_changed', function() {
  var place = _g_autocomplete.getPlace();
    //console.log(place);
  });

}



Aucun commentaire:

Enregistrer un commentaire