Skip to content

Commit

Permalink
Renders captcha outside angular zone (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Sep 25, 2018
1 parent 0c56d72 commit 15369cf
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,13 @@ export abstract class BaseReCaptchaComponent implements OnChanges, ControlValueA
* Responsible for instantiating captcha element
*/
protected renderReCaptcha(): void {
this.captchaId = this.reCaptchaApi.render(this.captchaElemId, this.getCaptchaProperties());
this.ready.next();

// run outside angular zone due to timeout issues when testing
// details: https://github.com/Enngage/ngx-captcha/issues/26
this.zone.runOutsideAngular(() => {
this.captchaId = this.reCaptchaApi.render(this.captchaElemId, this.getCaptchaProperties());
this.ready.next();
});
}

/**
Expand Down

0 comments on commit 15369cf

Please sign in to comment.