Google maps autocomplete, fix to the input

后端 未结 5 1270
再見小時候
再見小時候 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:08

    I was now able to reproduce the problem, the solution is simply adding position: relative to your wrapper box and position: absolute to your #autocomplete input.

    I got the solution checking the example provided by the Google team.

    I've updated your fiddle to match the solution, but it goes like this:

    Your updated CSS:

    .box {
      position: relative;
      height: 200vh;
    }
    
    #autocomplete {
        width:350px;
        position: absolute;
    }
    

提交回复
热议问题