mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
show email validation error until you make a change
This commit is contained in:
parent
d6e5637dbe
commit
fa91a57b35
1 changed files with 7 additions and 1 deletions
|
@ -124,6 +124,8 @@ class EmailStep extends React.Component {
|
|||
handleSubmit,
|
||||
isSubmitting,
|
||||
setFieldError,
|
||||
setFieldTouched,
|
||||
setFieldValue,
|
||||
validateField
|
||||
} = props;
|
||||
return (
|
||||
|
@ -166,7 +168,11 @@ class EmailStep extends React.Component {
|
|||
validationClassName="validation-full-width-input"
|
||||
/* eslint-disable react/jsx-no-bind */
|
||||
onBlur={() => validateField('email')}
|
||||
onFocus={() => setFieldError('email', null)}
|
||||
onChange={e => {
|
||||
setFieldValue('email', e.target.value);
|
||||
setFieldTouched('email');
|
||||
setFieldError('email', null);
|
||||
}}
|
||||
/* eslint-enable react/jsx-no-bind */
|
||||
onSetRef={this.handleSetEmailRef}
|
||||
/>
|
||||
|
|
Loading…
Reference in a new issue