feat: auto-focus first fields.

This commit is contained in:
elforjani3
2020-12-01 15:14:05 +02:00
parent b5b9764676
commit d299785bfb
8 changed files with 59 additions and 12 deletions

View File

@@ -13,10 +13,14 @@ import {
import { CLASSES } from 'common/classes';
import { inputIntent } from 'utils';
import { useAutofocus } from 'hooks';
/**
* Vendor form primary section.
*/
function VendorFormPrimarySection() {
const firstNameFieldRef = useAutofocus();
return (
<div className={'customer-form__primary-section-content'}>
{/**----------- Vendor name -----------*/}
@@ -50,6 +54,7 @@ function VendorFormPrimarySection() {
placeholder={'First Name'}
intent={inputIntent({ error, touched })}
className={classNames('input-group--first-name')}
inputRef={(ref) => (firstNameFieldRef.current = ref)}
{...field}
/>
)}