我尝试了社区建议的所有解决方案。但到了 2021 年,它们都不起作用了。尝试过
autoComplete ="off",
autoComplete ="nope"
autoComplete={'' + Math.random()}
有人有新的解决方案吗?这是我正在使用的输入组件
<input
autoComplete={'' + Math.random()}
key={name}
value={value}
onChange={onChange}
className="input--custom"
id={name}
name={name}
type={type}
/>
最佳答案
你可以使用
autoComplete="new-password"
来自docs
If you are defining a user management page where a user can specify a new password for another person, and therefore you want to prevent autofilling of password fields, you can use autocomplete="new-password".
关于javascript - React JS autoComplete ="off "不起作用 ---Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69233118/