I'm having an issue getting Chrome's autofill and/or autocomplete working with Polymer input elements, such as gold-email-input. I've tried setting the autocomplete
attribute of the gold-email-input component to on
and I've also tried setting it to email
. The autofill box appears, but selecting an entry from the autofill selections does not populate the control. What am I doing wrong?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
<form is="iron-form">
<gold-email-input></gold-email-input>
</form>
This tends to work
回答2:
You don't need to set the autocomplete
attribute, as it's already set to autocomplete=email
.
I think we need to see a sample of your code in context because the input automatically populates for me when I select the autofill suggestion:
jsbin
回答3:
Try wrapping your input elements in a form element. This works for me:
<form>
<paper-input id="user"
autocomplete="email"
label="Username or email"
value="{{user}}"
</paper-input>
<paper-input id="pwd"
autocomplete="current-password"
label="Password"
value="{{pwd}}"
</paper-input>
</form>