Error onChange on resetCaptcha
See original GitHub issuengx-captcha version: 7.0.0
Everytime i use resetCaptcha method, is throwing me in console this error
TypeError: _this.onChange is not a function
at ngx-captcha.js:168
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (polyfills.f8cdd893844be2043f68.js:6876)
at Object.onInvoke (core.js:17299)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (polyfills.f8cdd893844be2043f68.js:6875)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (polyfills.f8cdd893844be2043f68.js:6635)
at NgZone.push../node_modules/@angular/core/fesm5/core.js.NgZone.run (core.js:17213)
This is the original ngx-captcha.js:168
BaseReCaptchaComponent.prototype.resetCaptcha = /**
* Resets captcha
* @return {?}
*/
function () {
var _this = this;
this.zone.run((/**
* @return {?}
*/
function () {
// reset captcha using Google js api
_this.reCaptchaApi.reset();
// required due to forms
_this.onChange(undefined);
_this.onTouched(undefined);
// trigger reset event
_this.reset.next();
}));
};
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
onChange event not working after window.reacptcha.reset() in ...
Now the problem is that when user clicks on the recaptcha for first time its working fine and instantly the green tick is...
Read more >onChange breaks after reset · Issue #14 - GitHub
I'm trying to get my Recaptcha component to reset, based on a redux store dispatch, but none of the reset examples here apply...
Read more >Captcha on reset password form causes error with invalid key
Adding reCaptcha checkbox to reset password form causes problem: “This key is invalid or has already been used. Please reset your password again...
Read more >How to implement reCAPTCHA in a React application
In this article, we'll demonstrate how to implement reCAPTCHA v2 in a React application and how to verify user tokens in a Node.js...
Read more >react-google-recaptcha - npm.io
import ReCAPTCHA from "react-google-recaptcha"; function onChange(value) ... getWidgetId() returns the recaptcha widget Id; reset() forces reset.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That seems to be working fine on the live demo. You can see the implementation at https://github.com/Enngage/ngx-captcha/blob/master/demo/src/re-captcha-2-demo.component.ts
Are you providing proper formControl to captcha element? If not, are you using standalone mode such as:
This seems to be working on the demo app. It is defined at https://github.com/Enngage/ngx-captcha/blob/master/demo/src/invisible-recaptcha-demo.component.ts#L29