dozoisch / dozoisch/react-google-recaptcha

Delay of captcha removing disallows second captcha initialization during that time

Open
#166 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.1k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

**Description:**
We have a signup form in a Popup modal.
User can toggle the popup.

When popup is closed ReCAPTCHA componentWillUnmount fires:
```
componentWillUnmount() {
if (this._widgetId !== undefined) {
this.delayOfCaptchaIframeRemoving();
this.reset();
}
}
```
Delay is 5000ms.
When user opens same popup quicker than 5000ms recaptcha **won't be initialized**.

To kinda deal with it I have to manually remove element .grecaptcha-badge in componentWillUnmount of the component consuming ReCAPTCHA. This way everything works but that's ugly 👎

Can we have an option to disable this custom logic on componentWillUnmount as it makes impossible to have new ReCAPTCHA initialized within 5 sec delay.

Additionally:
There seems to be no harm with the error: _uncaught (in promise) timeout_ to fix which the changes where made in this PR: https://github.com/dozoisch/react-google-recaptcha/pull/120/files
It is internal false positive error originating from google script and it doesn't block further code execution.
It was discussed here: https://github.com/dozoisch/react-google-recaptcha/issues/103 as well.

react-google-recaptcha version: 2.0.1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.