diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c4df70c13..8295e2afdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Draft +- Write a review modal extra executions. [#1902](https://github.com/bigcommerce/cornerstone/pull/1902) ## 4.12.1 (11-10-2020) - Write a Review modal cause TypeError. [#1899](https://github.com/bigcommerce/cornerstone/pull/1899) diff --git a/assets/js/theme/product.js b/assets/js/theme/product.js index 0c4c20020f..e47d105cf3 100644 --- a/assets/js/theme/product.js +++ b/assets/js/theme/product.js @@ -46,7 +46,11 @@ export default class Product extends PageManager { const review = new Review($reviewForm); - $(document).on('opened.fndtn.reveal', () => this.reviewModal.setupFocusableElements(WRITE_REVIEW)); + $(document).on('opened.fndtn.reveal', (event) => { + if ($(event.target).attr('id') === 'modal-review-form') { + this.reviewModal.setupFocusableElements(WRITE_REVIEW); + } + }); $('body').on('click', '[data-reveal-id="modal-review-form"]', () => { validator = review.registerValidation(this.context);