В поле ввода типа приставки текстовое поле теряет фокус после 1-го изменения? - PullRequest
0 голосов
/ 31 марта 2020
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 ' />

После ввода текста текстовое поле теряет фокус.

1 Ответ

0 голосов
/ 31 марта 2020
added in **renderInput** function input attribute
<input
                    type='text'
                    {...input}
                    autoFocus={meta.active}
                    autoComplete='off'
                    placeholder={label}
                />
it is working...
...