Automattic / newspack-blocks

Gutenberg blocks for the Newspack project.
205 stars 43 forks source link

fix(ras-acc): add check to prevent JS error in variation modal #1862

Closed laurelfulford closed 1 month ago

laurelfulford commented 1 month ago

All Submissions:

Changes proposed in this Pull Request:

I noticed this randomly while testing another PR: the changes I made to keep modals open while redirecting broke the ability to close the variation modal.

How to test the changes in this Pull Request:

  1. On epic/ras-acc, set up a Checkout Button block with a variable product where the reader can pick the variation.
  2. On the front end, click the Checkout Button block to open the variation picker.
  3. Click the close button; note it doesn't close and throws a JS error.
  4. Apply this PR and run npm run build.
  5. Repeat steps 2-3 and confirm that the modal closes as expected.
  6. Repeat a couple of the tests from https://github.com/Automattic/newspack-blocks/pull/1855 and confirm that the modal-not-closing-when-redirecting behaviour still works as expected.

Other information:

laurelfulford commented 1 month ago

Closing; it looks like this is already fixed in https://github.com/Automattic/newspack-blocks/pull/1861 😆