Antd的Input.Password,谷歌浏览器自动填充功能导致样式变化

1,060 阅读1分钟

根据MDN的文档,使用autoComplete属性,autoComplete="new-password" || "off" 都不起效果,修改name属性也不起效果,通过百度的一篇文章blog.csdn.net/weixin_4462… , 添加了

input:-internal-autofill-previewed,
input:-internal-autofill-selected {
  transition: background-color 5000s ease-in-out 0s !important;
}

这样一串代码解决了