Fix google maps autocomplete to the input

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:

Position bug when scroll

So I tried different things like changing the position of .pac-container but it doesn’t solve the problem. When I inspect the page, it seems that the results container loads at the end of the page, so it’s not easy to make the block stick to the input bar.


I already searched everywhere and didn’t fidn any suitable solution ? Does someone have an idea how to do it ? (It’s actually just a simple code like this:

function initialize() {
        var options = {componentRestrictions: {country: 'uk'}, types: ['geocode']}
    new google.maps.places.Autocomplete(
    (document.getElementById('autocomplete')), options);



Thanks in advance, Robin Fourcade.