Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal dialog after add to cart on PDP cannot be closed with "X" or "Continue Shopping" if Product Reviews are disabled #1896

Open
joeldentici opened this issue Nov 7, 2020 · 1 comment

Comments

@joeldentici
Copy link

Expected behavior

If you disable product reviews on a site, you should be able to get past the modal dialog after adding to cart by continuing shopping (not just proceeding to checkout).

Actual behavior

Due to a JS error in an event fired when the dialog opens, it seems that not all event listeners for closing the dialog get subscribed and therefore the dialog will not close.

Steps to reproduce behavior

  1. From BC control panel, go to "Advanced Settings" / "Comments" / "Built-in"
  2. Under "Enable for", uncheck "Product Reviews"
  3. Save
  4. Go to any PDP
  5. Configure product and add to cart

From here you will see the described behavior. Re-enabling product reviews makes this go away.

Note, the error that causes this issue is thrown on this line:

$(document).on('opened.fndtn.reveal', () => this.reviewModal.setupFocusableElements(WRITE_REVIEW));

Suggested Fix (confirmed this fixes the issue):

        $(document).on('opened.fndtn.reveal', () => {
            try {
                this.reviewModal.setupFocusableElements(WRITE_REVIEW);
            } catch (e) { /* ignore error that occurs when product reviews are disabled. */ }
        });
@yurytut1993
Copy link
Contributor

Hi @joeldentici!
Thanks for detailed steps to reproduce. This issue should be fixed in release 4.12.1. Try to update and check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants