breezefront / theme-frontend-breeze-blank

Breeze Blank Theme
11 stars 3 forks source link

Login / Register Buttons keep disabled when Google reCAPTCHA is enabled #6

Closed JDavidVR closed 8 months ago

JDavidVR commented 8 months ago

First of all, thanks for a great and high performance theme.

I had an issue on Magento OpenSource 2.4.6-p3, when I configure recaptcha

image

In login form, the button stays disabled

image

I've reviewed code:

In this template:

https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Customer/view/frontend/templates/form/login.phtml#L51

line 51, when recaptcha is enabled it disable the button by default

$block->getButtonLockManager()->isDisabled('customer_login_form_submit')

so there is a JS logic that eanbles it, it is in lin 64:

https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Customer/view/frontend/templates/form/login.phtml#L64

                 "Magento_Customer/js/block-submit-on-send": {
                    "formId": "login-form"
                },

Checking the JS file: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Customer/view/frontend/web/js/block-submit-on-send.js

it is incharge of enabling the button.

I'm new in Breezefront JS logic so not sure how to migrate it to make it compatible.

Thanks in Advance

vovayatsyuk commented 8 months ago

Looks like the old bug is alive again :) It was previously fixed here: https://github.com/breezefront/module-breeze/commit/cc07ff8056f2739ad226e51bbd61b4d64e438708

Now, it's broken again because we've added the login popup into the DOM structure, which uses the button with the same id. Unlike jQuery, Cashjs returns the first element only when using id selector.

Just fixed it by modifying the selector: https://github.com/breezefront/module-breeze/commit/688b53ce7a5b668910b1cfc57243127f040323bf

Thanks for reporting with all the details!

JDavidVR commented 8 months ago

thanks @vovayatsyuk the fix works!