mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
when select dropdown is focused, clear any validation errors
This commit is contained in:
parent
303481b61d
commit
628e00f401
2 changed files with 13 additions and 2 deletions
|
@ -84,7 +84,8 @@ class BirthDateStep extends React.Component {
|
|||
const {
|
||||
errors,
|
||||
handleSubmit,
|
||||
isSubmitting
|
||||
isSubmitting,
|
||||
setFieldError
|
||||
} = props;
|
||||
return (
|
||||
<JoinFlowStep
|
||||
|
@ -118,6 +119,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(
|
||||
|
@ -131,6 +135,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