When i trying to write something -> loosing focus on first onChange with redux-form ( Field Arrays ). v6.5.0
Method with render
const renderEmails = ({ fields, meta: { touched, error, submitFailed } }) => (
<div className="col-xs-12">
{fields.map((email, index) =>
<div key={index} className="fieldArray-container relative">
<div className="absolute-link left" style={indexStyle}>
{index + 1}
</div>
<button
type="button"
title="Remove rule"
className="btn btn-link absolute-link right"
style={removeButtonStyle}
onClick={() => fields.remove(index)}>
<i className="fa fa-times-circle" />
</button>
<Field
style={inputStyle}
name={`${email}.email`}
type="text"
component={Input}
/>
</div>
)}
<div className="text-center"><button type="button" className="btn btn-link" onClick={() => fields.push({})}>+ Add Employee</button></div>
{(touched || submitFailed) && error && <div className="alert alert-danger">{error}</div>}
</div>
);
Call fieldarray
<FieldArray name="employeeEmails" component={renderEmails} />