Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autocomplete组件可以传递autocomplete属性到input元素上 #1610

Closed
JerryChan31 opened this issue Nov 17, 2021 · 5 comments · Fixed by #1619
Closed

autocomplete组件可以传递autocomplete属性到input元素上 #1610

JerryChan31 opened this issue Nov 17, 2021 · 5 comments · Fixed by #1619
Labels
feature request New feature or request

Comments

@JerryChan31
Copy link
Contributor

This function solves the problem (这个功能解决的问题)

浏览文档过程中发现:
image

这种行为似乎有些怪异?

是否可以提供选项传递autocomplete属性到原生input上;

HTML autocomplete 属性可用于以文本或数字值作为输入的 <input> 元素 , <textarea> 元素, <select> 元素, 和<form> 元素。 autocomplete 允许web开发人员指定,如果有任何权限 user agent 必须提供填写表单字段值的自动帮助,并为浏览器提供关于字段中所期望的信息类型的指导。 -- quote from MDN Docs

可以让开发者自己选择是否让浏览器提示;如果接受二者共存的情况,也可以指定提示的类型,让浏览器更好地提示。

Expected API (期望的 API)

native-autocomplete="string"
透传到实际的input上的autocomplete属性;

@github-actions github-actions bot added the feature request New feature or request label Nov 17, 2021
@nooooooom
Copy link
Contributor

nooooooom commented Nov 17, 2021

input-props ?

@JerryChan31
Copy link
Contributor Author

input-props ?

类似,但是看文档auto-complete组件上没有这个属性。

@07akioni
Copy link
Collaborator

@JerryChan31 这种情况用 input 就好了吧?

@JerryChan31
Copy link
Contributor Author

@JerryChan31 这种情况用 input 就好了吧?

我觉得主要奇怪的场景在于同时出现两个提示的情况,强迫症感到有点奇怪。

我在我的 Mac 上试了一下,安装了 Chrome + 1Password 插件。

2021-11-17.9.33.40.mov

在确实需要autocomplete的提示的场景,例如输入邮箱,这时 1Password 会跳出来,遮挡住 autocomplete 组件展示的提示内容。这种体验看起来比较糟糕。

这种情况我觉得可能需要提供可以写入autocomplete="off"的方式来给浏览器 / 浏览器插件一些提示。

https://1password.community/discussion/117501/as-a-web-developer-how-can-i-disable-1password-filling-for-a-specific-field 这里提到如果设置autocomplete="off"input上,1Password 不会介入。

但我没有明白…为什么只有文档里的autocomplete的这个示例会触发 1Password…autocomplete 里的其他示例、input组件里的示例、arco文档里的 autocomplete 和 input、element 文档里的 input 都不会触发……有点诡异。

@07akioni
Copy link
Collaborator

07akioni commented Nov 17, 2021

我知道了,那给安排个 input-props 吧,看起来还是有必要的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants