首页 > 解决方案 > Chrome中的自动填充错误?

问题描述

这里发生了什么?在 Chrome 中,如果您单击输入,则会自动完成country. 如果您更改countrycity,您将获得 的自动完成功能city

这是一个最小的案例。如果您摆脱表格或摆脱输入,则行为消失。

<table>
    <tr>
        <td>country</td>
    </tr>
    <tr>
        <td>
            <input autocomplete="off">
            <input autocomplete="off">
            <input autocomplete="off">
        </td>
    </tr>
</table>

我正在运行 Chrome,版本 89.0.4389.82(官方构建)(64 位)(我刚刚升级到 89.0.4389.90,问题仍然存在。)

试试看:https ://codepen.io/timkay/pen/abBMGRE


chrome自动填充错误

标签: htmlgoogle-chromeautocomplete

解决方案


我找到了一个丑陋的解决方法:更改任何麻烦的单词,如country, city,address等,以便浏览器无法识别它们。这是一个例子:

<div><span style="display: none;">x</span>country</div>

推荐阅读