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
Product Gallery block: Prevent page from scrolling when pop-up is open #43378
Product Gallery block: Prevent page from scrolling when pop-up is open #43378
Conversation
Hi @danieldudzic, @samueljseay, @roykho, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
Test Results SummaryCommit SHA: 94bca53
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
@@ -40,6 +40,7 @@ const closeDialog = ( context: ProductGalleryContext ) => { | |||
context.isDialogOpen = false; | |||
// Reset the main image. | |||
context.selectedImage = context.firstMainImageId; | |||
document.body.classList.remove( 'modal-open' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it would be better to namespace this classname so that there is no chance of a conflict if some other extensions are doing the same. Perhaps wc-block-product-gallery-modal-open
? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it might be nice to namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion! Included in 56537ac
@@ -60,6 +61,7 @@ const productGallery = { | |||
openDialog: () => { | |||
const context = getContext(); | |||
context.isDialogOpen = true; | |||
document.body.classList.add( 'modal-open' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! I just fixed it in 94bca53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes. I no longer see the scroll bar on popover good job!
…n pop-up is open (#43378) * Prevent body from scrolling when pop-up is open * Add changefile(s) from automation for the following project(s): woocommerce-blocks * Add namespace to the modal-open css class * Fix class name for the Product Gallery block --------- Co-authored-by: github-actions <github-actions@github.com>
Submission Review Guidelines:
Changes proposed in this Pull Request:
Closes #43343 .
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Changelog entry
Significance
Type
Message
Comment
Prevent page scrolling when the Product Gallery Pop-Up is open.