简体   繁体   English

Google Chrome自动完成功能不起作用

[英]Google Chrome autocomplete not working

I get the autocomplete suggestions when I type, but when I select the value it doesn't populate the field. 键入时会收到自动完成建议,但是当我选择该值时,不会填充该字段。

Here is a GIF to illustrate the issue. 这是GIF来说明问题。 https://media.giphy.com/media/lzwkRcCKiLafkRcjEE/giphy.gif https://media.giphy.com/media/lzwkRcCKiLafkRcjEE/giphy.gif

Here is another example of it working, then stopping to work: 这是它工作的另一个示例,然后停止工作:

HTML 的HTML

<input type="text" name="last-name" autocomplete="last-name" value="MacIsaac">

The form is built with React 该表单是使用React构建的

According to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete , autocomplete="family-name" should autocomplete to the last name. 根据https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input#attr-autocomplete,autocomplete autocomplete="family-name"应该自动完成为姓氏。

So the end result should be: <input type="text" name="last-name" autocomplete="family-name" value="MacIsaac"> 因此,最终结果应为: <input type="text" name="last-name" autocomplete="family-name" value="MacIsaac">

确保您的输入包含在form元素中,并且自动完成功能将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM