mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Merge pull request #3361 from benjiwheeler/join-flow-dropdown-validation
when select dropdown is focused, clear any validation errors
This commit is contained in:
commit
ecdfaeeeec
2 changed files with 13 additions and 2 deletions
|
@ -85,7 +85,8 @@ class BirthDateStep extends React.Component {
|
|||
const {
|
||||
errors,
|
||||
handleSubmit,
|
||||
isSubmitting
|
||||
isSubmitting,
|
||||
setFieldError
|
||||
} = props;
|
||||
return (
|
||||
<JoinFlowStep
|
||||
|
@ -119,6 +120,9 @@ class BirthDateStep extends React.Component {
|
|||
'validation-birthdate-month',
|
||||
'validation-left'
|
||||
)}
|
||||
/* eslint-disable react/jsx-no-bind */
|
||||
onFocus={() => setFieldError('birth_month', null)}
|
||||
/* eslint-enable react/jsx-no-bind */
|
||||
/>
|
||||
<FormikSelect
|
||||
className={classNames(
|
||||
|
@ -132,6 +136,9 @@ class BirthDateStep extends React.Component {
|
|||
options={birthYearOptions}
|
||||
validate={this.validateSelect}
|
||||
validationClassName="validation-birthdate-year"
|
||||
/* eslint-disable react/jsx-no-bind */
|
||||
onFocus={() => setFieldError('birth_year', null)}
|
||||
/* eslint-enable react/jsx-no-bind */
|
||||
/>
|
||||
</div>
|
||||
<div className="join-flow-privacy-message">
|
||||
|
|
|
@ -64,7 +64,8 @@ class CountryStep extends React.Component {
|
|||
const {
|
||||
errors,
|
||||
handleSubmit,
|
||||
isSubmitting
|
||||
isSubmitting,
|
||||
setFieldError
|
||||
} = props;
|
||||
return (
|
||||
<JoinFlowStep
|
||||
|
@ -93,6 +94,9 @@ class CountryStep extends React.Component {
|
|||
options={this.countryOptions}
|
||||
validate={this.validateSelect}
|
||||
validationClassName="validation-full-width-input"
|
||||
/* eslint-disable react/jsx-no-bind */
|
||||
onFocus={() => setFieldError('country', null)}
|
||||
/* eslint-enable react/jsx-no-bind */
|
||||
/>
|
||||
{/* note that this is a hidden checkbox the user will never see */}
|
||||
<FormikCheckbox
|
||||
|
|
Loading…
Reference in a new issue