Skip to content

Commit 3a85576

Browse files
committed
ACP2E-1338: Google reCaptcha in Incorrect position
1 parent f9b8bb7 commit 3a85576

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

ReCaptchaCheckout/view/frontend/web/js/reCaptchaCheckout.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,23 @@ define(
4949
*/
5050
isCheckoutReCaptchaRequiredFor: function (method) {
5151
return !this.skipPayments || !this.skipPayments.hasOwnProperty(method.getCode());
52+
},
53+
54+
/**
55+
* @inheritdoc
56+
*/
57+
initCaptcha: function () {
58+
var $wrapper, $recaptchaResponseInput;
59+
60+
this._super();
61+
// Since there will be multiple recaptcha in the payment form,
62+
// they may override each other if the form is submitted.
63+
// The recaptcha response will be collected in the callback: reCaptchaCallback()
64+
$wrapper = $('#' + this.getReCaptchaId() + '-wrapper');
65+
$recaptchaResponseInput = $wrapper.find('[name=g-recaptcha-response]');
66+
if ($recaptchaResponseInput.length) {
67+
$recaptchaResponseInput.prop('disabled', true);
68+
}
5269
}
5370
});
5471
}

0 commit comments

Comments
 (0)