Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions ReCaptchaFrontendUi/view/frontend/web/js/reCaptcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ define(
*/
initialize: function () {
this._super();
this._loadApi();

this.attachFocusEvent();
},

attachFocusEvent: function () {
let parentForm = $('#' + this.getReCaptchaId() + '-container').parents('form');
let self = this;

parentForm.find('input, select').on('focus', function () {
self._loadApi();
});
},

/**
Expand Down Expand Up @@ -59,9 +69,7 @@ define(
* @returns {Boolean}
*/
getIsInvisibleRecaptcha: function () {
if (this.settings ===

void 0) {
if (this.settings === void 0) {
return false;
}

Expand Down Expand Up @@ -95,9 +103,7 @@ define(
widgetId,
parameters;

if (this.captchaInitialized || this.settings ===

void 0) {
if (this.captchaInitialized || this.settings === void 0) {
return;
}

Expand Down