在重复形式中,输入类型文本字段在第一次更改后失去焦点


const renderInput = ({ input, label, meta }) => {
return (
<div className={`field ${meta.error && meta.touched ? 'error' : ''}`}>
<label>{label}</label>
<input type='text' {...input} autoComplete='off' />
</div>
);
};
<Field name='title' component={renderInput} label='Enter Title ' />

输入后,文本字段将失去焦点。

added in **renderInput** function input attribute
<input
type='text'
{...input}
autoFocus={meta.active}
autoComplete='off'
placeholder={label}
/>
it is working...

最新更新