Google maps autocomplete, fix to the input

后端 未结 5 1274
再見小時候
再見小時候 2020-12-19 02:43

I\'m trying to add a google maps autocomplete input to my ionic app. It works pretty well except when I scroll. As shown on the image:

So I tried different th

5条回答
  •  情书的邮戳
    2020-12-19 03:22

    I have the same problem. My solution was:

    $('#inputContainer').scroll(function(){
        //Set new top to autocomplete dropdown
        newTop = $('#autocompleteInput').offset().top + $('#autocompleteInput').outerHeight();
        $('.pac-container').css('top', newTop + 'px');
      }
    });
    

    This update the dropdown position when container scrolls.

提交回复
热议问题