Reactjs 如何在Redux表单中禁用Chrome自动完成
我正在使用React redux表单输入,这是我的代码:Reactjs 如何在Redux表单中禁用Chrome自动完成,reactjs,Reactjs,我正在使用React redux表单输入,这是我的代码: return ( <Field key={name} component={SurveyField} type="text" label={label} name={name} autocomplete="off" /> ); 我想Chrome只是忽略了自动完成。
return (
<Field
key={name}
component={SurveyField}
type="text"
label={label}
name={name}
autocomplete="off"
/>
);
我想Chrome只是忽略了自动完成。我已经看到了其他StackOverflow问题,但它们没有帮助。我发现,将autocomplete属性添加到组件回调函数中定义的
标记中,而不是依赖redux表单
标记将此属性传递给DOM,将在生成的html中正确设置此属性autocomplete=“off”
将按预期工作。可能的重复(tl;dr:autocomplete
,而不是autocomplete
)。可能的重复都会提供可能重复的链接,但没有使用redux表单的有效解决方案
autocomplete="off"
autoComplete="off"