mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-08-01 00:31:06 -04:00
Make sure the "create account" button is clickable until captcha is actually solved.
This commit is contained in:
parent
f83fa4390c
commit
b8b76f69ba
1 changed files with 5 additions and 1 deletions
|
@ -62,11 +62,15 @@ class EmailStep extends React.Component {
|
||||||
handleValidSubmit (formData, formikBag) {
|
handleValidSubmit (formData, formikBag) {
|
||||||
this.formData = formData;
|
this.formData = formData;
|
||||||
this.formikBag = formikBag;
|
this.formikBag = formikBag;
|
||||||
|
// Change set submitting to false so that if the user clicks out of
|
||||||
|
// the captcha, the button is clickable again (instead of a disabled button with a spinner).
|
||||||
|
this.formikBag.setSubmitting(false);
|
||||||
this.grecaptcha.execute(this.widgetId);
|
this.grecaptcha.execute(this.widgetId);
|
||||||
}
|
}
|
||||||
captchaSolved (token) {
|
captchaSolved (token) {
|
||||||
|
// Now thatcaptcha is done, we can tell Formik we're submitting.
|
||||||
|
this.formikBag.setSubmitting(true);
|
||||||
this.formData['g-recaptcha-response'] = token;
|
this.formData['g-recaptcha-response'] = token;
|
||||||
this.formikBag.setSubmitting(false);
|
|
||||||
this.props.onNextStep(this.formData);
|
this.props.onNextStep(this.formData);
|
||||||
}
|
}
|
||||||
setCaptchaRef (ref) {
|
setCaptchaRef (ref) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue