Chrome强制输入自动完成,渲染位置自动完成损坏

时间:2019-02-23 18:40:49

标签: html google-maps google-chrome autocomplete google-places-api

我有以下内容:

([follow.user] + follow.user.to_a - [follow.user]).uniq

我反对:

 var initAutocomplete = function (inputId) {
    // Create the autocomplete object, restricting the search to geographical
    // location types.

    var autocomplete = new google.maps.places.Autocomplete(
        /** @type {!HTMLInputElement} */(document.getElementById(inputId)),
        { types: ['geocode'] });

    // When the user selects an address from the dropdown, populate the address
    // fields in the form.
    autocomplete.addListener('place_changed', function () { handleAddress(this) });
    return autocomplete;
}

它可以工作,但是自动完成团队和Chrome团队之间出现了令人讨厌的重叠:

enter image description here

如果我从 <input id="address-search" placeholder="Address" class="top-search" /> id中删除“地址”一词,我会得到想要的,但是我希望在占位符中有地址。我尝试将各种placeholder html属性设置为无效。如何阻止google对我的需求做出假设?

0 个答案:

没有答案