Google places autocomplete not working in Windows mobile IE Browser

前端 未结 2 1124
清酒与你
清酒与你 2021-02-06 05:39

We are building a mobile site for our product ridingo.

We use the google places autocomplete feature extensively on our site. This is used to provide suggestions to user

2条回答
  •  一整个雨季
    2021-02-06 06:02

    I've tried to do a little tweak with jquery. It is a temporary solution, hopefully google will manage to solve this bug.

    Ive added following code after initializing my autocomplete text field:

    
    

    And when loading:

    $(function() {
      var autocomplete = new google.maps.places.Autocomplete((document.getElementById('maps-autocomplete')));
      $('#maps-autocomplete').keyup(function(e) {
        var container = $('.pac-container').first();
        if (container.offset().top > $(this).offset().top + $(this).outerHeight()) {
          container.offset(
            {
              top: $(this).offset().top + $(this).outerHeight()
            }
          );
        }
      });
    });
    

    It only works on the second enter of a character, but at least it works for this time.

提交回复
热议问题